Discussion:
[cairo] [Regression in 1.15] pdftocairo -pdf inverts image color in this PDF (#105294)
Bryce Harrington
2018-06-07 23:44:10 UTC
Permalink
Has anyone had a chance to look into this? Is a proper fix feasible
within a couple weeks (before I do the next 1.15 snapshot)? If it's not
feasible and a revert has to be done, would one of you like to take care
of that or should I handle it? I'll try to revisit this issue again
before finalizing the snapshot, at least to follow up with the revert if
nothing else is possible.

Thanks,
Bryce
Dear Peter, dear Adrian,
As reported in bug #105294 [1], the commit b207a932a (Correctly decode Adobe
CMYK JPEGs in PDF export) [2] with the description below cause a regression
that images in PDFs are inverted.
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.
Most users are affected wanting to print PDFs created by Adobe Photoshop
causing the prints to be unusable. With the commit reverted, the printout is
fine.
Do you know of a fix or should the commit be reverted for now?
Kind regards,
Paul
[1] https://bugs.freedesktop.org/show_bug.cgi?id=105294
[2] https://cgit.freedesktop.org/cairo/commit/?id=b207a932a2d3740984319dffd58a0791580597c
--
cairo mailing list
https://lists.cairographics.org/mailman/listinfo/cairo
--
cairo mailing list
***@cairographics.org
https://lists.cairographics.org/mailman/l
Bryce Harrington
2018-10-16 16:58:40 UTC
Permalink
Dear Bryce,
Post by Bryce Harrington
Has anyone had a chance to look into this?
I do not think so.
Ah, actually on the bug report there was some subsequent discussion and
analysis. The commenters suggest that some PDF viewers already include
code to invert CMYK for Adobe Photoshop JPEGs, so including the
workaround in Cairo double-inverts in that case.

Possibly this is just something that PDF viewers need to handle
themselves, or maybe there is a more sophisticated solution that can be
added to Cairo. But in either case I agree we should avoid introducing
regressed behavior for 1.16, and back out the patch until someone can
dig into this deeper.
Post by Bryce Harrington
Is a proper fix feasible within a couple weeks (before I do the next
1.15 snapshot)? If it's not feasible and a revert has to be done,
would one of you like to take care of that or should I handle it?
It’d be great if you could do it. `git revert` and adding a reference to
the bug report.
Will do.
Post by Bryce Harrington
I'll try to revisit this issue again before finalizing the snapshot,
at least to follow up with the revert if nothing else is possible.
It’d be great, if this could be done before the 1.16 release.
Thanks for reminding me about this.

Bryce
--
cairo mailing list
***@cairographics.org
https://lists.cairographics.org/mailman
Loading...