You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2016/11/30 21:53:59 UTC
[jira] [Resolved] (PDFBOX-3608) byte/short tiff tags not read
correctly
[ https://issues.apache.org/jira/browse/PDFBOX-3608?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tilman Hausherr resolved PDFBOX-3608.
-------------------------------------
Resolution: Fixed
Assignee: Tilman Hausherr
Thank you for your excellent report + solution + test!
> byte/short tiff tags not read correctly
> ---------------------------------------
>
> Key: PDFBOX-3608
> URL: https://issues.apache.org/jira/browse/PDFBOX-3608
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 2.0.3
> Reporter: Štěpán Schejbal
> Assignee: Tilman Hausherr
> Priority: Minor
> Fix For: 2.0.4, 2.1.0
>
> Attachments: fix.patch, test-files.zip
>
>
> 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)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org