Browse Source

--- Merging r14972 into '.':
U packages/fcl-image/src/fpreadpng.pp

# revisions: 14972
------------------------------------------------------------------------
r14972 | marco | 2010-03-04 23:33:05 +0100 (Thu, 04 Mar 2010) | 1 line
Changed paths:
M /trunk/packages/fcl-image/src/fpreadpng.pp

* committed an old patch from M Schreiber, mantis #11855 that fixes loading 8-bit gray alpha using PNG loading.
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@14981 -

marco 15 years ago
parent
commit
c8cacc0263
1 changed files with 4 additions and 4 deletions
  1. 4 4
      packages/fcl-image/src/fpreadpng.pp

+ 4 - 4
packages/fcl-image/src/fpreadpng.pp

@@ -519,15 +519,15 @@ end;
 function TFPReaderPNG.ColorGrayAlpha8 (CD:TColorData) : TFPColor;
 var c : word;
 begin
-  c := CD and $FF00;
-  c := c + (c shr 8);
+  c := CD and $00FF;
+  c := c + (c shl 8);
   with result do
     begin
     red := c;
     green := c;
     blue := c;
-    c := CD and $FF;
-    alpha := c + (c shl 8);
+    c := CD and $FF00;
+    alpha := c + (c shr 8);
     end;
 end;