Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.3
-
None
Description
All tag values (even byte/short) are currently read as a long value. That works fine as long as the value is padded with 0. Unfortunately, the very first file from production environment I tried to process with CCITTFactory failed, because short value was not padded with 0 (the complete tag data is 1201 0300 0100 0000 0100 3832 - little endian):
java.io.IOException: Orientation 842530817 is not supported
at org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.extractFromTiff(CCITTFactory.java:392)
at org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.createFromRandomAccessImpl(CCITTFactory.java:219)
at org.apache.pdfbox.pdmodel.graphics.image.CCITTFactory.createFromFile(CCITTFactory.java:167)
at org.apache.pdfbox.pdmodel.graphics.image.CCITTFactoryTest.testCreateFromRandomAccessSingle(CCITTFactoryTest.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)