pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1650813 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/Predictor.java
Date Sat, 10 Jan 2015 21:51:08 GMT
Author: tilman
Date: Sat Jan 10 21:51:08 2015
New Revision: 1650813

URL: http://svn.apache.org/r1650813
Log:
PDFBOX-2576: the result of int divide by int is always an int

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/Predictor.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/Predictor.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/Predictor.java?rev=1650813&r1=1650812&r2=1650813&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/Predictor.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/filter/Predictor.java Sat Jan 10 21:51:08
2015
@@ -127,7 +127,7 @@ public class Predictor
                             int avg = actline[p] & 0xff;
                             int left = p - bytesPerPixel >= 0 ? actline[p - bytesPerPixel]
& 0xff : 0;
                             int up = lastline[p] & 0xff;
-                            actline[p] = (byte) ((avg + (int) Math.floor((left + up) / 2))
& 0xff);
+                            actline[p] = (byte) ((avg + (left + up) / 2) & 0xff);
                         }
                         break;
                     case 14:// PRED PAETH



Mime
View raw message