On Tue, 27 Dec 2005 17:35:01 +0200
Markku Niskanen <[EMAIL PROTECTED]> wrote:

> I noticed a small error in intfgraphics.pas: The
> 
> TLazReaderPartIcon.InternalCheck function should be
> something like this:
> 
> function TLazReaderPartIcon.InternalCheck(Stream: TStream): boolean;
> var bfh: Array[0..21] of byte;
> begin
>   Stream.Read(bfh,22); // dummy read of ico file header
>   Result:=True; { Assumes stream in the correct place }
> end;

Does not seem to work.

 
> At its present state it does not read the file header at all and 
> reading the icon is broken.
> 
> or possibly a copy of the TLazReaderIcon.InternalCheck function
> 
> function TLazReaderIcon.InternalCheck(Stream: TStream): boolean;
> var
>   IconHeader: TIconHeader;
> begin
>   FnStartPos := Stream.Position;
>   Stream.Read(IconHeader,SizeOf(IconHeader));
>   With IconHeader do
>     Result := (idReserved=0) and (LEtoN(idType)=1);
>   FnIcons := LEtoN(IconHeader.idCount);
> end;

That would be better. But how?

Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to