pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1656634 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java
Date Tue, 03 Feb 2015 07:32:37 GMT
Author: tilman
Date: Tue Feb  3 07:32:36 2015
New Revision: 1656634

URL: http://svn.apache.org/r1656634
Log:
PDFBOX-2654: fix bug in bit shifting

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java?rev=1656634&r1=1656633&r2=1656634&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java
Tue Feb  3 07:32:36 2015
@@ -496,10 +496,14 @@ public abstract class PDXObjectImage ext
             for (int y = 0, h = bi.getHeight(); y < h; ++y)
             {
                 int rgb = bi.getRGB(x, y);
-                alphaImage.setRGB(x, y, (rgb >>> 24) | (rgb >>> 16) | (rgb
>>> 8));
+                int alpha = (rgb >>> 24);
+                alphaImage.setRGB(x, y, alpha | alpha << 8 | alpha << 16);
             }
         }
+        
         return alphaImage;
+        
+        
     }            
 
     // create alpha image from alpha raster



Mime
View raw message