FOP
  1. FOP
  2. FOP-1736

[PATCH] afp renderer does not respect image color settings for svg

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 0.95
    • Fix Version/s: None
    • Component/s: unqualified
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC
    • External issue ID:
      48237

      Description

      Color svg, declared both inline (<fo:instream-foreign-object>) and external (<fo:external-graphic>), are not rendered to afp as black and white under the following fop.xconf configuration:

      <renderer mime="application/x-afp">
      <images mode="b+w" bits-per-pixel="8"/>
      ..
      </renderer>

      The attached includes sample xsl-fo and afp output to demonstrate.

      1. color_svg.zip
        2 kB
        Peter Hancock
      2. hello.fo
        0.6 kB
        Venkat Reddy
      3. patch_48237.txt
        21 kB
        Peter Hancock
      4. bug_48237.patch
        25 kB
        Peter Hancock
      5. bug_48237.patch
        32 kB
        Peter Hancock

        Activity

        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed
        Hide
        Chris Bowditch added a comment -

        Thanks for the patch Peter. Committed to SVN in revision 897221

        Show
        Chris Bowditch added a comment - Thanks for the patch Peter. Committed to SVN in revision 897221
        Hide
        Peter Hancock added a comment -

        Updated patch.

        Moved some files to xmlgraphics commons

        Show
        Peter Hancock added a comment - Updated patch. Moved some files to xmlgraphics commons
        Hide
        Peter Hancock added a comment -

        Attachment bug_48237.patch has been added with description: patch of proposed fix

        Show
        Peter Hancock added a comment - Attachment bug_48237.patch has been added with description: patch of proposed fix
        Hide
        Peter Hancock added a comment -

        Attachment bug_48237.patch has been added with description: patch of proposed fix

        Show
        Peter Hancock added a comment - Attachment bug_48237.patch has been added with description: patch of proposed fix
        Hide
        Peter Hancock added a comment -

        Implements a grayscale color conversion utility that is used when setting the color value on the GOCA stream whilst rendering SVG to AFP in grayscale.

        WARNING
        This patch will depend upon an update to xmlgraphics-commons that includes the patch defined in Attachment #24724 of XGC-32

        Show
        Peter Hancock added a comment - Implements a grayscale color conversion utility that is used when setting the color value on the GOCA stream whilst rendering SVG to AFP in grayscale. WARNING This patch will depend upon an update to xmlgraphics-commons that includes the patch defined in Attachment #24724 of XGC-32
        Hide
        Peter Hancock added a comment -

        Attachment patch_48237.txt has been added with description: patch of proposed fix

        Show
        Peter Hancock added a comment - Attachment patch_48237.txt has been added with description: patch of proposed fix
        Hide
        Chris Bowditch added a comment -

        Jeremias,

        our local B+W AFP Printer handles this and converts the colour SVG to B+W on the fly. However, one of our customers with B+W Printers said the AFP failed to print due to the colour in the GOCA objects. We believe this is a bug and should be fixed.

        Thanks,

        Chris

        Show
        Chris Bowditch added a comment - Jeremias, our local B+W AFP Printer handles this and converts the colour SVG to B+W on the fly. However, one of our customers with B+W Printers said the AFP failed to print due to the colour in the GOCA objects. We believe this is a bug and should be fixed. Thanks, Chris
        Hide
        Jeremias Maerki added a comment -

        Peter, I understand the bug report (all colors should ideally be transformed to grayscales when AFP output is configured to 8bit grayscales), but what I'm curious about is whether the current behaviour actually caused a problem on your side. So far I have no reports that the colors cause any problems. The systems seem to be able to handle them correctly, even on a monochrome system. Only the bitmap images are currently reduced in color depth most of all because that has a huge impact on file size.

        Show
        Jeremias Maerki added a comment - Peter, I understand the bug report (all colors should ideally be transformed to grayscales when AFP output is configured to 8bit grayscales), but what I'm curious about is whether the current behaviour actually caused a problem on your side. So far I have no reports that the colors cause any problems. The systems seem to be able to handle them correctly, even on a monochrome system. Only the bitmap images are currently reduced in color depth most of all because that has a huge impact on file size.
        Hide
        Venkat Reddy added a comment -

        I have checked this bug with FOP 0.95 version initially, but later understood that FOPTrunk is having this problem instead of FOP 0.95.

        The Bitmaps are rendering according the image mode configuration (either b+w or color) in both FOP 0.95 and FOPTrunk.

        The problem is with SVGs, the image mode is not respected in case of SVGs in FOPTrunk.

        So, It is a valid bug in FOPTrunk....

        Show
        Venkat Reddy added a comment - I have checked this bug with FOP 0.95 version initially, but later understood that FOPTrunk is having this problem instead of FOP 0.95. The Bitmaps are rendering according the image mode configuration (either b+w or color) in both FOP 0.95 and FOPTrunk. The problem is with SVGs, the image mode is not respected in case of SVGs in FOPTrunk. So, It is a valid bug in FOPTrunk....
        Hide
        Venkat Reddy added a comment -

        Attachment hello.fo has been added with description: Input FO file

        Show
        Venkat Reddy added a comment - Attachment hello.fo has been added with description: Input FO file
        Hide
        Venkat Reddy added a comment -

        Hi Peter,

        There is no bug with this functionality. You can have a look at the FO file that I have used...

        1. Update the configuration file for the image mode (b+w or color)
        2. Run the following command from the command prompt...
        C:\mywork\FOP\fop-0.95> fop -c C:\fop.xconf -fo C:\mywork\JavaXSLTSamples\XSLFOSamples\hello.fo -afp C:\mywork\JavaXSLTSamples\XSLFOSamples\hellotest.afp

        According to the mode, the image will be rendered with color or black and white...

        Thanks,
        Venkat.

        Show
        Venkat Reddy added a comment - Hi Peter, There is no bug with this functionality. You can have a look at the FO file that I have used... 1. Update the configuration file for the image mode (b+w or color) 2. Run the following command from the command prompt... C:\mywork\FOP\fop-0.95> fop -c C:\fop.xconf -fo C:\mywork\JavaXSLTSamples\XSLFOSamples\hello.fo -afp C:\mywork\JavaXSLTSamples\XSLFOSamples\hellotest.afp According to the mode, the image will be rendered with color or black and white... Thanks, Venkat.
        Hide
        Peter Hancock added a comment -

        Attachment color_svg.zip has been added with description: sample fo and afp

        Show
        Peter Hancock added a comment - Attachment color_svg.zip has been added with description: sample fo and afp

          People

          • Assignee:
            fop-dev
            Reporter:
            Peter Hancock
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development