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 2018/02/25 09:46:00 UTC

[jira] [Comment Edited] (PDFBOX-4121) (-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true) takes much time

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

Tilman Hausherr edited comment on PDFBOX-4121 at 2/25/18 9:45 AM:
------------------------------------------------------------------

I ran the profiler and it turns out that the loading of the image itself is slow:
{code}
        ImageReader reader = ImageIO.getImageReadersByFormatName("JPEG2000").next();
        FileInputStream input = new FileInputStream("PDFBOX-4121.jp2");
        ImageInputStream iis = ImageIO.createImageInputStream(input);
        reader.setInput(iis, true, true);
        reader.read(0);
{code}
this takes a long time when read from a stream. Not when read from a file. And not with this small modification:
{code}
        ImageReader reader = ImageIO.getImageReadersByFormatName("JPEG2000").next();
        FileInputStream input = new FileInputStream("PDFBOX-4121.jp2");
        ImageInputStream iis = new MemoryCacheImageInputStream(input);
        reader.setInput(iis, true, true);
        reader.read(0);
{code}
It turns out that java was providing a {{FileCacheImageInputStream}}.


was (Author: tilman):
The loading of the image itself is slow:
{code}
        ImageReader reader = ImageIO.getImageReadersByFormatName("JPEG2000").next();
        FileInputStream input = new FileInputStream("PDFBOX-4121.jp2");
        ImageInputStream iis = ImageIO.createImageInputStream(input);
        reader.setInput(iis, true, true);
        reader.read(0);
{code}
this takes a long time when read from a stream. Not when read from a file. And not with this small modification:
{code}
        ImageReader reader = ImageIO.getImageReadersByFormatName("JPEG2000").next();
        FileInputStream input = new FileInputStream("PDFBOX-4121.jp2");
        ImageInputStream iis = new MemoryCacheImageInputStream(input);
        reader.setInput(iis, true, true);
        reader.read(0);
{code}
It turns out that java was providing a {{FileCacheImageInputStream}}.

> (-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true) takes much time
> ------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4121
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4121
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Rendering
>    Affects Versions: 2.0.8
>            Reporter: savan patel
>            Priority: Major
>              Labels: DeviceCMYK
>         Attachments: 5a55177653dee.pdf, PDFBOX-4121.jp2
>
>
> I have a pdf in which page 1 gets around 45 sec to render when i set the property (-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true) and without it it takes 20 sec.
> and something weird happens to me. when i don't set this property (System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider")) then i get this warning "WARNING: Could not read JPEG 2000 (JPX) image" . is it some jar related warning or it happen to u also?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org