You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have both GD and Imagick installed in my PHP. In my PDF, I use an image created with Imagick on which I add a CMYK profile for printing (CoatedFOGRA39.icc).
The resulting PDF generated with TCPDF has bad colors so the profile I give is not used and is replaced by something else or is simply removed.
I tracked this down to the Image() function. If GD is installed, it uses imagecreatetruecolor() and other functions that modify the original image and its data. If I comment out the block starting at if (($info === false) AND function_exists($gdfunction)) { then TCPDF correctly uses imagick and everything is fine because it finds the icc profile and keeps it.
So here are my suggestions to fix this:
Change the order, call imagick before GD (imagick is better at everything so it should benefit everyone, but it is a potential BC break)
Add a parameter to specify which image library to use. Most php image libraries do this these days. Keep this parameter empty by default. Example:
$pdf->setImageLibrary('imagick');
Any ideas?
The text was updated successfully, but these errors were encountered:
I have both GD and Imagick installed in my PHP. In my PDF, I use an image created with Imagick on which I add a CMYK profile for printing (CoatedFOGRA39.icc).
The resulting PDF generated with TCPDF has bad colors so the profile I give is not used and is replaced by something else or is simply removed.
I tracked this down to the
Image()
function. If GD is installed, it uses imagecreatetruecolor() and other functions that modify the original image and its data. If I comment out the block starting atif (($info === false) AND function_exists($gdfunction)) {
then TCPDF correctly usesimagick
and everything is fine because it finds the icc profile and keeps it.So here are my suggestions to fix this:
Any ideas?
The text was updated successfully, but these errors were encountered: