pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1835595 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java
Date Tue, 10 Jul 2018 18:52:38 GMT
Author: tilman
Date: Tue Jul 10 18:52:37 2018
New Revision: 1835595

URL: http://svn.apache.org/viewvc?rev=1835595&view=rev
Log:
PDFBOX-4184: fix heuristics

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java?rev=1835595&r1=1835594&r2=1835595&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/LosslessFactory.java
Tue Jul 10 18:52:37 2018
@@ -665,7 +665,8 @@ public final class LosslessFactory
             long sum = 0;
             for (byte aDataRawRowSub : dataRawRowSub)
             {
-                sum += aDataRawRowSub & 0xFF;
+                // https://www.w3.org/TR/PNG-Encoders.html#E.Filter-selection
+                sum += Math.abs(aDataRawRowSub);
             }
             return sum;
         }



Mime
View raw message