pdftocairo -pdf inverts image color in this PDF
Submitted by Jason Crain
Assigned to Adrian Johnson @ajohnson
Link to original bug (#105294)
Description
Created attachment 137691 doc_with_whitespace.pdf
I noticed this while verifying that https://bugzilla.gnome.org/show_bug.cgi?id=757876 has been fixed in cairo. The 'missing spaces' problem is fixed, but I see a new issue now.
If I run pdftocairo -pdf
on the attached PDF file, images in the output PDF show reversed black and white. I traced it to this commit in cairo:
commit b207a932 (HEAD, refs/bisect/bad) Author: Peter TB Brett peter.brett@livecode.com Date: Fri Sep 9 22:35:55 2016 +0930
Correctly decode Adobe CMYK JPEGs in PDF export
Adobe PhotoShop generates CMYK JPEG files with inverted CMYK. When a
JPEG file with this format is included in a PDF file, a `/Decode`
array must be included to convert to "normal" CMYK.
These JPEG files can be detected via the presence of the APP14 "Adobe"
marker. However, PDF viewers are not required to detect and handle
this private marker, so it must be detected and handled (by adding a
`/Decode`) by the PDF generator.
Signed-Off-By: Peter TB Brett <peter.brett@livecode.com>
Attachment 137691, "doc_with_whitespace.pdf":
doc_with_whitespace.pdf