You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by bu...@apache.org on 2011/07/02 14:05:23 UTC

DO NOT REPLY [Bug 51465] New: Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

             Bug #: 51465
           Summary: Significant slowdown in PNG and TIFF processing with
                    xmlgraphics 1.4
           Product: XMLGraphicsCommons
           Version: 1.4
          Platform: PC
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Image codecs
        AssignedTo: general@xmlgraphics.apache.org
        ReportedBy: patches@portaildulibre.fr
    Classification: Unclassified


Created attachment 27243
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27243
Profiler

Hello, 
I’m using fop 1.0 (xmlgraphics 1.4) to generate PDF, I noticed that PDF
generation with PNG or TIF image is 7 times longer. 
The problem doesn't appear in the version 1.3 of xmlgraphics.


The problem seems to come from color model associated with the image.
* if is_sRGB_stdStale = true then getRBG method is very fast
* if is_sRGB_stdStale = false then getRBG  is slow because the treatment is
delegated to ICC_ColorSpace.toRGB

The color model is correct, but it is modified by the class
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderImageIO
by the following code : 
            if (providerIgnoresICC && cm instanceof ComponentColorModel) {
                // Apply ICC Profile to Image by creating a new image with a
new color model.
                ICC_Profile iccProf = tryToExctractICCProfile(iiometa);
                if (iccProf != null) {
                    ColorModel cm2 = new ComponentColorModel(
                            new ICC_ColorSpace(iccProf), cm.hasAlpha(), cm
                                    .isAlphaPremultiplied(), cm
                                    .getTransparency(), cm.getTransferType());
                    WritableRaster wr = Raster.createWritableRaster(imageData
                            .getSampleModel(), null);
                    imageData.copyData(wr);
                    BufferedImage bi = new BufferedImage(cm2, wr, cm2
                            .isAlphaPremultiplied(), null);
                    imageData = bi;
                    cm = cm2;

I removed this code and it works fine now, but it's dirty. What's the impact ?

Until a fix, best regards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

Bug 51465 depends on bug 51149, which changed state.

Bug 51149 Summary: [PATCH] slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

patches@portaildulibre.fr changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Image codecs                |ImageWriter
         OS/Version|                            |All

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

--- Comment #5 from patches@portaildulibre.fr ---
I attached the concerned PNG image.

The image is used inside a PDF document generated by FOP.
This image used by FOP 0.95+XmlGraphics 1.3.1 had no performance issue during
the PDF generation.
Changing JDK has no effect in my case.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

Bug 51465 depends on bug 51149, which changed state.

Bug 51149 Summary: [PATCH] slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

Glenn Adams <ga...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |51149

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

--- Comment #6 from Luis Bernardo <lm...@gmail.com> ---
Created attachment 29041
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29041&action=edit
an example to test icc profiles

the slowdown that happens between xmlgraphics-1.3 and xmlgraphics-1.4 is due to
the fact that the color profiles were being ignored in 1.3 while in 1.4 they
are taken into account, as the PNG specification suggests. so even though 1.3
was faster, it was not correct. the impact of removing the check for color
profile is that the output may be wrong, although in most cases that does not
happen because the color pixel values in the PNG image already match what the
embedded color profile expects.

attached is an example with two images that look the same when viewed in an
application that does not apply color profiles (like Chrome), but that look
different when viewed with an application that applies the color profile (like
Safari). the example, when processed with FOP-0.95 (xmlgraphics-1.3) generates
two images that look the same, while with FOP-1.0 (xmlgraphics-1.4) the images
look different.

a workaround, as was suggested somewhere else, is to remove the color profile
from the image (this can be done with imagemagick). obviously this only works
in the cases where the color profile is not adding anything new to the image.
another option is to use the new raw png image loader, which for now, still
ignores the color profile (of course, this will not help in the cases where the
color profile is important).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

Glenn Adams <ga...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Glenn Adams <ga...@apache.org> ---
patch (from bug 51149) applied at:

http://svn.apache.org/viewvc?rev=1345323&view=rev

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

Bug 51465 depends on bug 51149, which changed state.

Bug 51149 Summary: [PATCH] slowdown in PNG processing when switching from JDK 1.6.0_17 to 1.6.0_18
https://issues.apache.org/bugzilla/show_bug.cgi?id=51149

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

patches@portaildulibre.fr changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from patches@portaildulibre.fr ---
Hi, 

We applied your patch but it dont fix my issue.
What information do you need about the PNG Image ?

Regards,

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

--- Comment #7 from Luis Bernardo <lm...@gmail.com> ---
as a follow-up to previous comment 6, see bug 40676, with attachment 29132 (a
patch that adds support for color profiles)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

patches@portaildulibre.fr changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |patches@portaildulibre.fr

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

--- Comment #4 from patches@portaildulibre.fr ---
Created attachment 28971
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28971&action=edit
PNG image

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


[Bug 51465] Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51465

--- Comment #3 from Luis Bernardo <lm...@gmail.com> ---
this bug is linked to bug 51149 but the issue may be different... the slowdown
addressed by the patch appeared due to a change in the jdk, not from a change
in xmlgraphics (from 1.3 to 1.4).

please provide the image so that the issue can be investigated. does it happen
with all images or just some?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org