Uploaded image for project: 'XMLGraphicsCommons'
  1. XMLGraphicsCommons
  2. XGC-55

Significant slowdown in PNG and TIFF processing with xmlgraphics 1.4

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Resolution: Unresolved
    • 1.4
    • None
    • image writer
    • None
    • Operating System: All
      Platform: PC

    Description

      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.

      Attachments

        1. testicc.tar.gz
          595 kB
          Luis Bernardo
        2. logo_rf.png
          46 kB
          OSC Member
        3. KOComponentColorModel.png
          28 kB
          OSC Member

        Issue Links

          Activity

            People

              general@xmlgraphics.apache.org XML Graphics Project Mailing List
              pdl OSC Member
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: