harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r666644 - /harmony/enhanced/classlib/trunk/modules/imageio/src/main/native/pngencoder/shared/pngencoder.c
Date Wed, 11 Jun 2008 12:33:17 GMT
Author: hindessm
Date: Wed Jun 11 05:33:17 2008
New Revision: 666644

URL: http://svn.apache.org/viewvc?rev=666644&view=rev
Log:
Fixing coding error and removing some zeroes.

Modified:
    harmony/enhanced/classlib/trunk/modules/imageio/src/main/native/pngencoder/shared/pngencoder.c

Modified: harmony/enhanced/classlib/trunk/modules/imageio/src/main/native/pngencoder/shared/pngencoder.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/imageio/src/main/native/pngencoder/shared/pngencoder.c?rev=666644&r1=666643&r2=666644&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/imageio/src/main/native/pngencoder/shared/pngencoder.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/imageio/src/main/native/pngencoder/shared/pngencoder.c
Wed Jun 11 05:33:17 2008
@@ -161,8 +161,10 @@
 
       for (i = 0;  i < paletteSize;  i ++) {          
           //printf("n%u = %u\n", i, (tmpPalette[i] & 0xff000000));
-          (pngPalette + i)->red = (png_byte) tmpPalette[i] & 0x00ff0000;
-          (pngPalette + i)->green = (png_byte) tmpPalette[i] & 0x000000ff00;
+          (pngPalette + i)->red =
+             (png_byte) ((tmpPalette[i] & 0x00ff0000) >> 16);
+          (pngPalette + i)->green =
+             (png_byte) ((tmpPalette[i] & 0x0000ff00) >> 8);
           (pngPalette + i)->blue = (png_byte) tmpPalette[i] & 0x000000ff;
 
           //alpha[i] = 256 - (tmpPalette[i] & 0xff000000);



Mime
View raw message