mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 23:30:43 +02:00
* 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:
parent
b45482e979
commit
ba10015c04
@ -192,7 +192,15 @@ begin
|
|||||||
Stream.Read(FHeader,SizeOf(FHeader));
|
Stream.Read(FHeader,SizeOf(FHeader));
|
||||||
Progress(psRunning, trunc(100.0 * (Stream.position / Stream.size)), False, Rect(0,0,0,0), '', ContProgress);
|
Progress(psRunning, trunc(100.0 * (Stream.position / Stream.size)), False, Rect(0,0,0,0), '', ContProgress);
|
||||||
if not ContProgress then exit;
|
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
|
// global palette
|
||||||
if (FHeader.Packedbit and $80) <> 0 then
|
if (FHeader.Packedbit and $80) <> 0 then
|
||||||
begin
|
begin
|
||||||
@ -207,7 +215,15 @@ begin
|
|||||||
|
|
||||||
// descriptor
|
// descriptor
|
||||||
Stream.Read(FDescriptor, SizeOf(FDescriptor));
|
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
|
// local palette
|
||||||
if (FDescriptor.Packedbit and $80) <> 0 then
|
if (FDescriptor.Packedbit and $80) <> 0 then
|
||||||
begin
|
begin
|
||||||
@ -522,5 +538,7 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
ImageHandlers.RegisterImageReader ('GIF Graphics', 'gif', TFPReaderGif);
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user