Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.2, 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: None

      Description

      I'd like to improve the tests for rendering.

      org/apache/pdfbox/util/TestPDFToImage.java is disabled in pdfbox\pom.xml . This has been disabled since 2009 ?! So I enabled it here.

      The subdir "rendering" is missing in pdfbox\target\test-output for these tests

      When a test fails because the rendered image is not identical, no detailed message appears on the console. It appears only in pdfbox.log and not on the console.

      this is because of the settings in
      pdfbox\src\test\resources\logging.properties

      If this is on purpose, please change the texts in pdfbox\src\test\java\org\apache\pdfbox\util*.java from

      "One or more failures, see test log for details"

      to

      "One or more failures, see test logfile 'pdfbox.log' for details"

      I wanted to attach a PDF with ccitt g4 compression and its rendering created with the 1.8.2 version, but it doesn't work out, seems that CIB generates files that can be rendered properly with 1.8.2. However I attach the TIFF g4 file, and a JBIG2 test file from it. I don't have access to a Xerox WorkCentre (enter jbig2 in google news ) so I used a free service, so there's a watermark.

      It should be included into
      pdfbox\src\test\resources\input\rendering
      I have created the image myself and I give it into the public domain.

      If my suggestion is accepted, it would be nice if people could create files that fail in current versions or have failed in old versions, and release these files to the public domain, so that they can be added to the tests.

      1. ccitt4.tif
        15 kB
        Tilman Hausherr
      2. jbig2test.pdf
        15 kB
        Tilman Hausherr
      3. jbig2test-01.png
        96 kB
        Tilman Hausherr

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          178d 1h 47m 1 John Hewson 08/Feb/14 19:57
          Resolved Resolved Closed Closed
          3h 15m 1 Andreas Lehmkühler 08/Feb/14 23:12
          Closed Closed Reopened Reopened
          146d 16h 35m 1 Tilman Hausherr 05/Jul/14 16:48
          Reopened Reopened Resolved Resolved
          100d 16h 55m 1 John Hewson 14/Oct/14 09:43
          Hide
          ASF subversion and git services added a comment -

          Commit 1679539 from Tilman Hausherr in branch 'pdfbox/trunk'
          [ https://svn.apache.org/r1679539 ]

          PDFBOX-1695: remove unneeded stuff, allow better outside access, reformat

          Show
          ASF subversion and git services added a comment - Commit 1679539 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1679539 ] PDFBOX-1695 : remove unneeded stuff, allow better outside access, reformat
          John Hewson made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          John Hewson added a comment -

          Looks like the basic improvements have been made, so I'm going to close this as fixed. We can still add any improvements under this issue ID until release.

          We also have a follow-up issue PDFBOX-1843, for any potential work on re-enabling rendering.

          Show
          John Hewson added a comment - Looks like the basic improvements have been made, so I'm going to close this as fixed. We can still add any improvements under this issue ID until release. We also have a follow-up issue PDFBOX-1843 , for any potential work on re-enabling rendering.
          John Hewson made changes -
          Fix Version/s 2.0.0 [ 12319281 ]
          Hide
          ASF subversion and git services added a comment -

          Commit 1621065 from Tilman Hausherr in branch 'pdfbox/trunk'
          [ https://svn.apache.org/r1621065 ]

          PDFBOX-1695: show diff result as absolute substraction of color differences, so that minor differences will be found, but not seen

          Show
          ASF subversion and git services added a comment - Commit 1621065 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1621065 ] PDFBOX-1695 : show diff result as absolute substraction of color differences, so that minor differences will be found, but not seen
          Hide
          ASF subversion and git services added a comment -

          Commit 1615014 from Tilman Hausherr in branch 'pdfbox/trunk'
          [ https://svn.apache.org/r1615014 ]

          PDFBOX-1695: fix incorrect if-statement

          Show
          ASF subversion and git services added a comment - Commit 1615014 from Tilman Hausherr in branch 'pdfbox/trunk' [ https://svn.apache.org/r1615014 ] PDFBOX-1695 : fix incorrect if-statement
          Hide
          Tilman Hausherr added a comment -

          Ignoring old *.diff.png files in rev 1610113 for the trunk.

          Show
          Tilman Hausherr added a comment - Ignoring old *.diff.png files in rev 1610113 for the trunk.
          Hide
          Tilman Hausherr added a comment - - edited

          Committed changes (create a diff image in target dir) for the trunk in rev 1608040 and 1608521. I'm leaving this open for a while, because we're discussing something related in the dev list.

          Show
          Tilman Hausherr added a comment - - edited Committed changes (create a diff image in target dir) for the trunk in rev 1608040 and 1608521. I'm leaving this open for a while, because we're discussing something related in the dev list.
          Tilman Hausherr made changes -
          Resolution Won't Fix [ 2 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Assignee Tilman Hausherr [ tilman ]
          Hide
          Tilman Hausherr added a comment -

          Reopen to commit my changes in TestPDFToImage. I have use this and improved it over the months and used to show regressions.

          Show
          Tilman Hausherr added a comment - Reopen to commit my changes in TestPDFToImage. I have use this and improved it over the months and used to show regressions.
          Andreas Lehmkühler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          John Hewson made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Won't Fix [ 2 ]
          Hide
          John Hewson added a comment -

          The PDFToImage test cannot be re-enabled because it does not work consistently across different JVMs. There is a new issue PDFBOX-1843 looking at ways to work around that problem. I've linked it to this issue so that we can make use of the test PDF files here.

          Show
          John Hewson added a comment - The PDFToImage test cannot be re-enabled because it does not work consistently across different JVMs. There is a new issue PDFBOX-1843 looking at ways to work around that problem. I've linked it to this issue so that we can make use of the test PDF files here.
          John Hewson made changes -
          Link This issue is superceded by PDFBOX-1843 [ PDFBOX-1843 ]
          Tilman Hausherr made changes -
          Link This issue is related to PDFBOX-1825 [ PDFBOX-1825 ]
          Hide
          Tilman Hausherr added a comment - - edited

          I've gone back to work on this; the idea would be to see if any revisions produce changed images, without looking at the image each time. I have a lot of images here that made troubles in the past, so a test can help find regressions.

          Add
          <dependency>
          <groupId>com.levigo.jbig2</groupId>
          <artifactId>levigo-jbig2-imageio</artifactId>
          <version>1.6.1</version>
          </dependency>

          and

          <repositories>
          <repository>
          <id>jbig2.googlecode</id>
          <name>JBIG2 ImageIO-Plugin repository at googlecode.com</name>
          <url>http://jbig2-imageio.googlecode.com/svn/maven-repository/</url>
          </repository>
          </repositories>

          to the pom of pdfbox subproject.

          TestPDFToImage.java:
          replace
          writer.writeImage(document, "png", "", 1, Integer.MAX_VALUE, outDir + file.getName() + "-");
          with
          writer.writeImage(document, "png", "", 1, Integer.MAX_VALUE, outDir + file.getName() + "-", BufferedImage.TYPE_USHORT_565_RGB, 96);

          The 96 is because the default resolution is dependent of the screen.

          Show
          Tilman Hausherr added a comment - - edited I've gone back to work on this; the idea would be to see if any revisions produce changed images, without looking at the image each time. I have a lot of images here that made troubles in the past, so a test can help find regressions. Add <dependency> <groupId>com.levigo.jbig2</groupId> <artifactId>levigo-jbig2-imageio</artifactId> <version>1.6.1</version> </dependency> and <repositories> <repository> <id>jbig2.googlecode</id> <name>JBIG2 ImageIO-Plugin repository at googlecode.com</name> <url> http://jbig2-imageio.googlecode.com/svn/maven-repository/ </url> </repository> </repositories> to the pom of pdfbox subproject. TestPDFToImage.java: replace writer.writeImage(document, "png", "", 1, Integer.MAX_VALUE, outDir + file.getName() + "-"); with writer.writeImage(document, "png", "", 1, Integer.MAX_VALUE, outDir + file.getName() + "-", BufferedImage.TYPE_USHORT_565_RGB, 96); The 96 is because the default resolution is dependent of the screen.
          Tilman Hausherr made changes -
          Field Original Value New Value
          Attachment jbig2test.pdf [ 12598017 ]
          Attachment jbig2test-01.png [ 12598018 ]
          Attachment ccitt4.tif [ 12598019 ]
          Hide
          Tilman Hausherr added a comment -

          ccitt g4 tif file and jbig2 test file. All created by myself and for public domain.

          Show
          Tilman Hausherr added a comment - ccitt g4 tif file and jbig2 test file. All created by myself and for public domain.
          Tilman Hausherr created issue -

            People

            • Assignee:
              Tilman Hausherr
              Reporter:
              Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development