pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1601552 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/CCITTFactory.java
Date Tue, 10 Jun 2014 06:08:44 GMT
Author: tilman
Date: Tue Jun 10 06:08:44 2014
New Revision: 1601552

URL: http://svn.apache.org/r1601552
Log:
PDFBOX-934: error message for unsupported G3 compression options

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=1601552&r1=1601551&r2=1601552&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
Tue Jun 10 06:08:44 2014
@@ -237,9 +237,18 @@ public final class CCITTFactory
                     }
                     case 292:
                     {
-                        if (val == 1)
+                        if ((val & 1) != 0)
                         {
-                            k = 50; // T4 2D - arbitary K value
+                            k = 50; // T4 2D - arbitary positive K value
+                        }
+                        // http://www.awaresystems.be/imaging/tiff/tifftags/t4options.html
+                        if ((val & 4) != 0)
+                        {
+                            throw new IOException("CCITT Group 3 'uncompressed mode' is not
supported");
+                        }
+                        if ((val & 2) != 0)
+                        {
+                            throw new IOException("CCITT Group 3 'fill bits before EOL' is
not supported");
                         }
                         break;
                     }



Mime
View raw message