From 284f5fd234cde0158db3f0b61091184d0de1c4e3 Mon Sep 17 00:00:00 2001 From: marco Date: Sat, 22 Nov 2014 13:46:33 +0000 Subject: [PATCH] * patch from mantis #24382 under endian ifdef git-svn-id: trunk@29103 - --- packages/fcl-image/src/fpreadpng.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/fcl-image/src/fpreadpng.pp b/packages/fcl-image/src/fpreadpng.pp index 0a3bef0dc1..af204af144 100644 --- a/packages/fcl-image/src/fpreadpng.pp +++ b/packages/fcl-image/src/fpreadpng.pp @@ -534,13 +534,21 @@ end; function TFPReaderPNG.ColorGrayAlpha16 (CD:TColorData) : TFPColor; var c : word; begin + {$ifdef FPC_LITTLE_ENDIAN} + c := CD and $FFFF; + {$else} c := (CD shr 16) and $FFFF; + {$endif} with result do begin red := c; green := c; blue := c; + {$ifdef FPC_LITTLE_ENDIAN} + alpha := (CD shr 16) and $FFFF; + {$else} alpha := CD and $FFFF; + {$endif} end; end;