pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1685169 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactory.java
Date Fri, 12 Jun 2015 21:04:33 GMT
Author: tilman
Date: Fri Jun 12 21:04:33 2015
New Revision: 1685169

URL: http://svn.apache.org/r1685169
Log:
PDFBOX-2576: clarify confusing comment, remove value that isn't used

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactory.java?rev=1685169&r1=1685168&r2=1685169&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactory.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactory.java
Fri Jun 12 21:04:33 2015
@@ -199,11 +199,14 @@ public final class CCITTFactory
                 throw new IOException("Not a valid tiff file");
             }
 
-            // Loop through the tags, some will convert to items in the parms dictionary
-            // Other point us to where to find the data stream
-            // The only parm which might change as a result of other options is K, so
-            // We'll deal with that as a special;
-            int k = -1000; // Default Non CCITT compression
+            // Loop through the tags, some will convert to items in the params dictionary
+            // Other point us to where to find the data stream.
+            // The only param which might change as a result of other TIFF tags is K, so
+            // we'll deal with that differently.
+            
+            // Default value to detect error
+            int k = -1000;
+            
             int dataoffset = 0;
             int datalength = 0;
 
@@ -344,7 +347,7 @@ public final class CCITTFactory
             reader.seek(dataoffset);
 
             byte[] buf = new byte[8192];
-            int amountRead = -1;
+            int amountRead;
             while ((amountRead = reader.read(buf, 0, Math.min(8192, datalength))) > 0)
             {
                 datalength -= amountRead;



Mime
View raw message