IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
On our online server the ICC (CMYK) color profile used for color conversion gets removed. On our local development server it does not get removed. Color conversion takes place on both environments anyhow, so the conversion actually happens.
We've installed identical versions of ImageMagick and Imagick to rule things out, but the issue still occurs. Any ideas as to what could be causing this?
// we're interested if ICC profile(s) exist
$profiles = $img->getImageProfiles('*', false);
$has_icc_profile = (array_search('icc', $profiles) !== false);
// if it doesnt have a RGB ICC profile, we add one
if ($has_icc_profile === false) {
$icc_profile = file_get_contents( './icc/color.org/sRGB_IEC61966-2-1_black_scaled.icc' );
$img->profileImage('icc', $icc_profile); unset($icc_profile);
}
// then we add a CMYK profile for conversion
$icc_profile = file_get_contents( './icc/ISOcoated_v2_300_eci.icc' );
$img->profileImage('icc', $icc_profile); unset($icc_profile);