pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1582786 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java
Date Fri, 28 Mar 2014 15:59:14 GMT
Author: tilman
Date: Fri Mar 28 15:59:13 2014
New Revision: 1582786

URL: http://svn.apache.org/r1582786
Log:
PDFBOX-457: ignore /Length value, not used by any other filter, and is wrong if this filter
is not the first

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java?rev=1582786&r1=1582785&r2=1582786&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/filter/CCITTFaxDecodeFilter.java
Fri Mar 28 15:59:13 2014
@@ -69,25 +69,7 @@ public class CCITTFaxDecodeFilter implem
         {
             decodeParms =  (COSDictionary)((COSArray)decodeP).getObject(filterIndex);
         }
-        int length = options.getInt(COSName.LENGTH, -1);
-        byte[] compressed = null;
-        if (length != -1)
-        {
-            compressed = new byte[length];
-            long written = IOUtils.populateBuffer(compressedData, compressed);
-            if (written != compressed.length)
-            {
-                log.warn("Buffer for compressed data did not match the length"
-                        + " of the actual compressed data");
-            }
-        }
-        else
-        {
-            // inline images don't provide the length of the stream so that
-            // we have to read until the end of the stream to find out the length
-            // the streams inline images are stored in are mostly small ones
-            compressed = IOUtils.toByteArray(compressedData);
-        }
+        byte[] compressed = IOUtils.toByteArray(compressedData);
         int cols = decodeParms.getInt(COSName.COLUMNS, 1728);
         int rows = decodeParms.getInt(COSName.ROWS, 0);
         int height = options.getInt(COSName.HEIGHT, COSName.H, 0);



Mime
View raw message