* Committed patch from Mantis 13331. gif is indeed always little endian.

Also added registration reader part of patch, since other readers do too.

git-svn-id: trunk@12996 -
This commit is contained in:
marco 2009-04-03 09:30:23 +00:00
parent b45482e979
commit ba10015c04

View File

@ -192,7 +192,15 @@ begin
Stream.Read(FHeader,SizeOf(FHeader));
Progress(psRunning, trunc(100.0 * (Stream.position / Stream.size)), False, Rect(0,0,0,0), '', ContProgress);
if not ContProgress then exit;
// Endian Fix Mantis 8541. Gif is always little endian
{$IFDEF ENDIAN_BIG}
with FHeader do
begin
ScreenWidth := LEtoN(ScreenWidth);
ScreenHeight := LEtoN(ScreenHeight);
end;
{$ENDIF}
// global palette
if (FHeader.Packedbit and $80) <> 0 then
begin
@ -207,7 +215,15 @@ begin
// descriptor
Stream.Read(FDescriptor, SizeOf(FDescriptor));
{$IFDEF ENDIAN_BIG}
with FDescriptor do
begin
Left := LEtoN(Left);
Top := LEtoN(Top);
Width := LEtoN(Width);
Height := LEtoN(Height);
end;
{$ENDIF}
// local palette
if (FDescriptor.Packedbit and $80) <> 0 then
begin
@ -522,5 +538,7 @@ begin
inherited Destroy;
end;
initialization
ImageHandlers.RegisterImageReader ('GIF Graphics', 'gif', TFPReaderGif);
end.