Bug 48264 - [PATCH] PS Renderer failed to process images using CMYK color space
[PATCH] PS Renderer failed to process images using CMYK color space
Status: CLOSED FIXED
Product: Fop - Now in Jira
Classification: Unclassified
Component: ps
all
PC Windows Vista
: P2 normal
: ---
Assigned To: fop-dev
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-11-23 07:42 UTC by Venkat Reddy
Modified: 2012-04-01 06:58 UTC (History)
1 user (show)



Attachments
CMYK color images patch for PS Renderer (1.39 KB, patch)
2009-11-23 07:42 UTC, Venkat Reddy
Details | Diff
Input FO file (566 bytes, text/plain)
2009-11-23 07:44 UTC, Venkat Reddy
Details
CMYK JPG image (427.61 KB, image/pjpeg)
2009-11-23 07:45 UTC, Venkat Reddy
Details
CMYK Tiff Image (586.79 KB, image/tiff)
2009-11-23 07:45 UTC, Venkat Reddy
Details
Postscript output file after the changes (521.22 KB, application/postscript)
2009-11-23 08:01 UTC, Venkat Reddy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Venkat Reddy 2009-11-23 07:42:37 UTC
Created attachment 24590 [details]
CMYK color images patch for PS Renderer

When trying to generate a PostScript output with CMYK images (JPG/Tiff), the PS renderer converting color space to RGB.

Please find the attachments for the test case and the CMYK images as well.
Comment 1 Venkat Reddy 2009-11-23 07:44:10 UTC
Created attachment 24591 [details]
Input FO file
Comment 2 Venkat Reddy 2009-11-23 07:45:02 UTC
Created attachment 24592 [details]
CMYK JPG image
Comment 3 Venkat Reddy 2009-11-23 07:45:48 UTC
Created attachment 24594 [details]
CMYK Tiff Image
Comment 4 Venkat Reddy 2009-11-23 07:52:27 UTC
Please find that the code changes are in XMLGraphicsCommons project, the patch should be applied to XMLGraphicsCommons and the 'xmlgraphics-commons-1.4svn.jar' should be placed in FopTrunk/lib to get the desired output.
Comment 5 Venkat Reddy 2009-11-23 08:01:26 UTC
Created attachment 24595 [details]
Postscript output file after the changes

Please find the CMYK color space with the output file after the patch applied.

like ...

%AXGBeginBitmap: C:\mywork\JavaXSLTSamples\XSLFOSamples\cmykimage.jpg
{{
/RawData currentfile /ASCII85Decode filter def
/Data RawData << >> /DCTDecode filter def
/DeviceCMYK setcolorspace
<<
  /Decode [1 0 1 0 1 0 1 0]
  /Width 500
  /BitsPerComponent 8
  /ImageType 1
  /DataSource Data
  /ImageMatrix [500 0 0 300 0 0]
  /Height 300
>> image
} stopped {handleerror} if
  RawData flushfile
} exec
Comment 6 Jeremias Maerki 2009-11-25 07:55:58 UTC
So the code was basically already there (due to the JPEG CMYK support) and only had to be enabled. Your patch could actually be further simplified. The check for the component count is not necessary as that is done inside ImageEncodingHelper already.

Patch applied: http://svn.apache.org/viewvc?rev=884159&view=rev
Thanks!
Comment 7 Glenn Adams 2012-04-01 06:58:04 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed