[
https://issues.apache.org/jira/browse/PDFBOX-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13774410#comment-13774410
]
Tilman Hausherr edited comment on PDFBOX-1695 at 9/24/13 7:02 AM:
------------------------------------------------------------------
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.
was (Author: tilman):
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>
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.
> Improve pdfbox tests
> --------------------
>
> Key: PDFBOX-1695
> URL: https://issues.apache.org/jira/browse/PDFBOX-1695
> Project: PDFBox
> Issue Type: Improvement
> Affects Versions: 1.8.2, 2.0.0
> Reporter: Tilman Hausherr
> Priority: Minor
> Labels: tdd, test-driven, testing
> Attachments: ccitt4.tif, jbig2test-01.png, jbig2test.pdf
>
>
> 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira