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 2014/01/18 10:20:19 UTC

[jira] [Commented] (PDFBOX-1852) [PATCH] Alternative patch to speed up TestImageIOUtils

    [ https://issues.apache.org/jira/browse/PDFBOX-1852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13875599#comment-13875599 ] 

Tilman Hausherr commented on PDFBOX-1852:
-----------------------------------------

Even if the purpose might have be different in 2011, I thought it was to see whether the sample pdf images could be rendered without crashing or freezing. With your change, this would be done only in the (usually disabled) TestPDFToImage.

But yes, it is true that saving to an image format need to be tested only once. One could do just the rendering without saving, or save to a ByteArrayOutputStream.

> [PATCH] Alternative patch to speed up TestImageIOUtils
> ------------------------------------------------------
>
>                 Key: PDFBOX-1852
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1852
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 1.8.3, 2.0.0
>            Reporter: John Hewson
>            Priority: Minor
>              Labels: patch, test
>         Attachments: TestImageIOUtils.patch, jpeg_demo.pdf, png_demo.pdf, raw_image_demo.pdf
>
>
> This is an alternative to the PDFBOX-1850 patch to speed up TestImageIOUtils.
> Rather than using multi-threading, this patch reduces the scope of the TestImageIOUtils test. The purpose of TestImageIOUtils is to check thatImageIOUtils can write jpeg, bmp and wbmp files without throwing an exception. Looking at the mailing list archive http://mail-archives.apache.org/mod_mbox/pdfbox-commits/201112.mbox/%3C20111218154622.3EE76238899C@eris.apache.org%3E we can see that the original issue was that the JPEG compression configuration broke BMP writing. It is therefore sufficient to convert only a single PDF file to each of the output formats in order to test this.
> The test is not quite so simple though, as TestImageIOUtils is also used for processing embedded images in PDF files and so needs to be tested on appropriate PDF files, this is not something that the current test suite was actually doing. I've therefore added some test PDF files containing PNGs,  JPEGs, and pixmaps. These are from libharu https://github.com/libharu/libharu and are under the ZLIB/LIBPNG license.
> Because TestImageIOUtils now only needs to be run on three files it takes around 2sec on my machine rather than over 30sec.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)