I have a problem using TCPDF to create PDF images containing a CMYK PNG file.
The system allows the user to upload photos, which can be JPG, GIF or PNG. ImageMagick converts these images to CMYK from RGB, where necessary. The image is then uploaded to the file server (Amazon S3).
When presented, the image is simply displayed on the screen in HTML on the Preview page, and clicking the button creates a PDF file.
PDF is the point at which the image becomes negative (color inversion). From what I can tell, the image remains as expected until the moment when TCPDF inserts the image into the document:
$tcpdf->Image($path_to_image, 0, 3.5, '42', '22', $file_extension, '', '', false, 300, '', false, false, 0, false, false, false);
----> 
File type is PNG, the extension is png . Color profile - CMYK. When opened in a browser, the image looks normal.
I also could not reproduce this in my local development environment, it only seems to be on a real site, which makes it even more difficult to replicate. This seems to only happen with PNG files.
OP this article conveys this issue in one of his ranting posts, but does not seem to resolve it.
Has anyone encountered this problem and figured out how to solve it? I assume this happens somewhere in the TCPDF class (v5.9.103), since the source file is fine.
php pdf pdf-generation tcpdf cmyk
Robbie averill
source share