Fop
  1. Fop
  2. FOP-1730

[PATCH] CMYK colors converted to RGB when not provided <fo:declarations> tag

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: general
    • Labels:
      None
    • Environment:
      Operating System: Windows Vista
      Platform: PC
    • External issue ID:
      48167

      Description

      When using uncalibrated CMYK colors in FO file without a declarations tag (no
      need to provide the declaration tag for the uncalibrated CMYK colors, as the
      color profile source is not a necessary) like....

      <fo:block color="rgb-icc(0, 255, 0, #CMYK, 1, 0, 1, 0)">GREEN TEXT</fo:block>
      <fo:block color="rgb-icc(0, 255, 255, #CMYK, 1, 0, 0, 0)">CYAN TEXT</fo:block>

      When trying to generate a AFP output, and the AFP renderer is using RGB color
      space instead of CMYK color space..

      When declarations tag is used, it is generating AFP output with CMYK color
      space.

      Please find the input file and output attached to this bug.

      1. CMYK_AFPExplorer.jpg
        114 kB
        Venkat Reddy
      2. CMYKDeclarations.001.patch.txt
        0.6 kB
        Harald G. Henne
      3. CMYKDeclarations.patch
        1.0 kB
        Venkat Reddy
      4. cmyk-test.fo
        2 kB
        Venkat Reddy
      5. cmyk-test.fo
        2 kB
        Venkat Reddy
      6. screenshot.pdf
        84 kB
        Harald G. Henne

        Issue Links

          Activity

          Hide
          Venkat Reddy added a comment -

          Attachment CMYK_AFPExplorer.jpg has been added with description: AFP output (RGB color space used for the uncalibrated CMYK)

          Show
          Venkat Reddy added a comment - Attachment CMYK_AFPExplorer.jpg has been added with description: AFP output (RGB color space used for the uncalibrated CMYK)
          Hide
          Venkat Reddy added a comment -

          Attachment cmyk-test.fo has been added with description: cmyk-test input fo document

          Show
          Venkat Reddy added a comment - Attachment cmyk-test.fo has been added with description: cmyk-test input fo document
          Hide
          Harald G. Henne added a comment -
          • my trunk output just contains CMYK and no RGB
          • could you please provide me your binary afp output file for futher analysis

          $ grep -A2 Color cmyk-test.dmp
          0x81: SEC Set Extended Color [14]
          Reserved: 00
          ColSpace: 0x04 (CMYK)

          0x81: SEC Set Extended Color [14]
          Reserved: 00
          ColSpace: 0x04 (CMYK)

          0x81: SEC Set Extended Color [14]
          Reserved: 00
          ColSpace: 0x04 (CMYK)

          0x81: SEC Set Extended Color [14]
          Reserved: 00
          ColSpace: 0x04 (CMYK)

          0x81: SEC Set Extended Color [14]
          Reserved: 00
          ColSpace: 0x04 (CMYK)

          Show
          Harald G. Henne added a comment - my trunk output just contains CMYK and no RGB could you please provide me your binary afp output file for futher analysis $ grep -A2 Color cmyk-test.dmp 0x81: SEC Set Extended Color [14] Reserved: 00 ColSpace: 0x04 (CMYK) – 0x81: SEC Set Extended Color [14] Reserved: 00 ColSpace: 0x04 (CMYK) – 0x81: SEC Set Extended Color [14] Reserved: 00 ColSpace: 0x04 (CMYK) – 0x81: SEC Set Extended Color [14] Reserved: 00 ColSpace: 0x04 (CMYK) – 0x81: SEC Set Extended Color [14] Reserved: 00 ColSpace: 0x04 (CMYK)
          Hide
          Venkat Reddy added a comment -

          Sorry, it was my mistake attached the wrong input file. Please find the newly attached input file for the bug.

          (In reply to comment #2)
          > - my trunk output just contains CMYK and no RGB
          > - could you please provide me your binary afp output file for futher analysis
          > $ grep -A2 Color cmyk-test.dmp
          > 0x81: SEC Set Extended Color [14]
          > Reserved: 00
          > ColSpace: 0x04 (CMYK)
          > –
          > 0x81: SEC Set Extended Color [14]
          > Reserved: 00
          > ColSpace: 0x04 (CMYK)
          > –
          > 0x81: SEC Set Extended Color [14]
          > Reserved: 00
          > ColSpace: 0x04 (CMYK)
          > –
          > 0x81: SEC Set Extended Color [14]
          > Reserved: 00
          > ColSpace: 0x04 (CMYK)
          > –
          > 0x81: SEC Set Extended Color [14]
          > Reserved: 00
          > ColSpace: 0x04 (CMYK)

          Show
          Venkat Reddy added a comment - Sorry, it was my mistake attached the wrong input file. Please find the newly attached input file for the bug. (In reply to comment #2) > - my trunk output just contains CMYK and no RGB > - could you please provide me your binary afp output file for futher analysis > $ grep -A2 Color cmyk-test.dmp > 0x81: SEC Set Extended Color [14] > Reserved: 00 > ColSpace: 0x04 (CMYK) > – > 0x81: SEC Set Extended Color [14] > Reserved: 00 > ColSpace: 0x04 (CMYK) > – > 0x81: SEC Set Extended Color [14] > Reserved: 00 > ColSpace: 0x04 (CMYK) > – > 0x81: SEC Set Extended Color [14] > Reserved: 00 > ColSpace: 0x04 (CMYK) > – > 0x81: SEC Set Extended Color [14] > Reserved: 00 > ColSpace: 0x04 (CMYK)
          Hide
          Venkat Reddy added a comment -

          Attachment cmyk-test.fo has been added with description: Correct Input file, please ignore the previous one

          Show
          Venkat Reddy added a comment - Attachment cmyk-test.fo has been added with description: Correct Input file, please ignore the previous one
          Hide
          Venkat Reddy added a comment -

          This patch resolves the bug, where no declarations tag is necessary for the uncalibrated CMYK.

          Show
          Venkat Reddy added a comment - This patch resolves the bug, where no declarations tag is necessary for the uncalibrated CMYK.
          Hide
          Venkat Reddy added a comment -

          Attachment CMYKDeclarations.patch has been added with description: CMYK Declarations patch

          Show
          Venkat Reddy added a comment - Attachment CMYKDeclarations.patch has been added with description: CMYK Declarations patch
          Hide
          Chris Bowditch added a comment -

          Hi Vincent,

          please can you process this patch?

          Thanks,

          Chris

          Show
          Chris Bowditch added a comment - Hi Vincent, please can you process this patch? Thanks, Chris
          Hide
          Harald G. Henne added a comment -

          The patch CMYKDeclarations.patch.txt is looking good for me
          but there is additional problem inside PtocaBuilder.setExtendedTextColor().

          A CMYK component with value 1.0 becomes to 256 witch does not fit into one
          byte. Finally 0x00 is written out at the moment, but 0xff is expected.

          Show
          Harald G. Henne added a comment - The patch CMYKDeclarations.patch.txt is looking good for me but there is additional problem inside PtocaBuilder.setExtendedTextColor(). A CMYK component with value 1.0 becomes to 256 witch does not fit into one byte. Finally 0x00 is written out at the moment, but 0xff is expected.
          Hide
          Harald G. Henne added a comment -

          Attachment CMYKDeclarations.001.patch.txt has been added with description: patch for PtocaBuilder.java

          Show
          Harald G. Henne added a comment - Attachment CMYKDeclarations.001.patch.txt has been added with description: patch for PtocaBuilder.java
          Hide
          Harald G. Henne added a comment -
          • text 'CYAN TEXT' is written out as white color '00 00 00 00' and
            not visible in any afp viewer
          • input: <fo:block color="rgb-icc(0, 255, 255, #CMYK, 1, 0, 0, 0)">CYAN TEXT</fo:block>
          • output with CMYKDeclarations.patch.txt but wrong color due to interger overflow
            0x81: SEC Set Extended Color [14]
            Reserved: 00
            ColSpace: 0x04 (CMYK)
            Reserved: 00 00 00 00
            Size1: 0x08 (8)
            Size2: 0x08 (8)
            Size3: 0x08 (8)
            Size4: 0x08 (8)
            ColValue: 00 00 00 00
            0xF1: SCFL Set Coded Font Local [1]
            CFLid: 0x01 (1)
            0xC5: SVI Set Variable-Space Char Increment [2]
            Value: 0x000B (11)
            0xDB: TRN Transparent Data [9]
            Text: "CYAN TEXT"
          • output with CMYKDeclarations.patch.txt and CMYKDeclarations.001.patch.txt
            0x81: SEC Set Extended Color [14]
            Reserved: 00
            ColSpace: 0x04 (CMYK)
            Reserved: 00 00 00 00
            Size1: 0x08 (8)
            Size2: 0x08 (8)
            Size3: 0x08 (8)
            Size4: 0x08 (8)
            ColValue: FF 00 00 00
            0xF1: SCFL Set Coded Font Local [1]
            CFLid: 0x01 (1)
            0xC5: SVI Set Variable-Space Char Increment [2]
            Value: 0x000B (11)
            0xDB: TRN Transparent Data [9]
            Text: "CYAN TEXT"
          Show
          Harald G. Henne added a comment - text 'CYAN TEXT' is written out as white color '00 00 00 00' and not visible in any afp viewer input: <fo:block color="rgb-icc(0, 255, 255, #CMYK, 1, 0, 0, 0)">CYAN TEXT</fo:block> output with CMYKDeclarations.patch.txt but wrong color due to interger overflow 0x81: SEC Set Extended Color [14] Reserved: 00 ColSpace: 0x04 (CMYK) Reserved: 00 00 00 00 Size1: 0x08 (8) Size2: 0x08 (8) Size3: 0x08 (8) Size4: 0x08 (8) ColValue: 00 00 00 00 0xF1: SCFL Set Coded Font Local [1] CFLid: 0x01 (1) 0xC5: SVI Set Variable-Space Char Increment [2] Value: 0x000B (11) 0xDB: TRN Transparent Data [9] Text: "CYAN TEXT" output with CMYKDeclarations.patch.txt and CMYKDeclarations.001.patch.txt 0x81: SEC Set Extended Color [14] Reserved: 00 ColSpace: 0x04 (CMYK) Reserved: 00 00 00 00 Size1: 0x08 (8) Size2: 0x08 (8) Size3: 0x08 (8) Size4: 0x08 (8) ColValue: FF 00 00 00 0xF1: SCFL Set Coded Font Local [1] CFLid: 0x01 (1) 0xC5: SVI Set Variable-Space Char Increment [2] Value: 0x000B (11) 0xDB: TRN Transparent Data [9] Text: "CYAN TEXT"
          Hide
          Harald G. Henne added a comment -

          Attachment screenshot.pdf has been added with description: before/after CMYKDeclarations.001.patch.txt

          Show
          Harald G. Henne added a comment - Attachment screenshot.pdf has been added with description: before/after CMYKDeclarations.001.patch.txt
          Hide
          Venkat Reddy added a comment -

          Hi Harald G. Henne,

          You are right, I have prepared two different patches( this bug relates to fo:declarations tag is not neccessary for uncalibrated CMYK colors, and the other patch for the FOP-1733 will fix the problem you mentioned).

          Please check the other bug for the details...

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

          I have enabled the dependency attribute between these two bugs...

          Show
          Venkat Reddy added a comment - Hi Harald G. Henne, You are right, I have prepared two different patches( this bug relates to fo:declarations tag is not neccessary for uncalibrated CMYK colors, and the other patch for the FOP-1733 will fix the problem you mentioned). Please check the other bug for the details... https://issues.apache.org/bugzilla/show_bug.cgi?id=48185 I have enabled the dependency attribute between these two bugs...
          Hide
          Vincent Hennebert added a comment -

          Patch applied in rev. 883310:
          http://svn.apache.org/viewvc?rev=883310&view=rev

          Thanks!
          Vincent

          Show
          Vincent Hennebert added a comment - Patch applied in rev. 883310: http://svn.apache.org/viewvc?rev=883310&view=rev Thanks! Vincent
          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

            People

            • Assignee:
              fop-dev
              Reporter:
              Venkat Reddy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development