Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMYK JPEGs appearing inverted in PDF output
Addresses issue [#1128](#1128) According to [libjpeg](https://github.com/libjpeg-turbo/libjpeg-turbo/blob/3c17063ef1ab43f5877f19d670dc39497c5cd036/libjpeg.txt#L1569-L1582) "it appears that Adobe Photoshop writes inverted data in CMYK JPEG files" An Adobe JPEG can be identified by the presence of the [APP14](https://exiftool.org/TagNames/JPEG.html#Adobe) segment. The code now checks for the `APP14` segment in `RasterImage` and adds a Decode Array to the XObject when rendering the CMYK JPEG. The value of the Decode Array is the inverse of the default value for DeviceCMYK according to the PDF spec. This has the effect of inverting the inverted image back to normal.
- Loading branch information