[ 
https://issues.apache.org/jira/browse/PDFBOX-2096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dominic Tubach updated PDFBOX-2096:
-----------------------------------

    Attachment: without_profile.png
                with_profile.png
                sample.pdf

Here is a sample PDF. It contains a light gray image. The attached images show 
the results when using the getRGBImage method. The without_profile.png shows 
the result with the current code. The image with_profile.png shows the result 
when the ICC profile is used which is obviously the expected result.

> ICC profile ignored if number of components is 1
> ------------------------------------------------
>
>                 Key: PDFBOX-2096
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2096
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.8.5
>            Reporter: Dominic Tubach
>         Attachments: sample.pdf, with_profile.png, without_profile.png
>
>
> The method getRGBImage in PDPixelMap ignores the ICC profile of an ICCBased 
> color space if the number of components is 1 (ll. 320-321 in 1.8.5):
> {code}
> byte[] map = new byte[] {(byte)0xff};
> cm = new IndexColorModel(bpc, 1, map, map, map, Transparency.OPAQUE);
> {code}
> This gives me a blank image in my PDF.
> If I use the code in l. 325
> {code}
> cm = colorspace.createColorModel( bpc );
> {code}
> I get the expected result.
> I'm sorry that I'm not allowed to attach the affected PDF. If required I 
> would try to generate a different one.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to