Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3608

byte/short tiff tags not read correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.3
    • 2.0.4, 3.0.0 PDFBox
    • PDModel
    • 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)

      Attachments

        1. fix.patch
          4 kB
          Štěpán Schejbal
        2. test-files.zip
          12 kB
          Štěpán Schejbal

        Activity

          People

            tilman Tilman Hausherr
            koloom@yahoo.com Štěpán Schejbal
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: