I am using ImageMagicks' convert command from a PHP application. I'd like to extract the color profile of a JPG, then strip it of all metadata and then put the color profile back in.
My code works fine on Windows, but on Linux the last step of putting the profile back in does not work. The return code is 0, but the target file does not have the profile. The exported ICC file is identical on Linux and Windows.
Here a sample code that I used for testing this:
Linux:
Code: Select all
system( '/usr/bin/convert -version', $ret );
system( '/usr/bin/convert source.jpg source.icc', $ret );
system( '/usr/bin/convert source.jpg -strip target_no_profile.jpg', $ret );
system( '/usr/bin/convert target_no_profile.jpg -set profile source.icc target_with_profile.jpg', $ret );
echo '</br>' . $ret;
Code: Select all
system( 'd:\imagemagick\convert.exe -version', $ret );
system( 'd:\imagemagick\convert.exe source.jpg source.icc', $ret );
system( 'd:\imagemagick\convert.exe source.jpg -strip target_no_profile.jpg', $ret );
system( 'd:\imagemagick\convert.exe target_no_profile.jpg -set profile source.icc target_with_profile.jpg', $ret );
Linux:
Code: Select all
Version: ImageMagick 6.3.5 06/04/09 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC
Code: Select all
Version: ImageMagick 6.6.6-6 2010-12-18 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC Features: OpenMP
Cheers, Robert