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

Tilman Hausherr commented on PDFBOX-4121:
-----------------------------------------

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
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to