Profile conversion and strip

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
tbraber

Profile conversion and strip

Post by tbraber »

Hi,

I want to convert an image with profile A to profile B. This all works fine if you do it like this:

my $image = Image::Magick->new();
$image->Read('sourcefile[0]')
... do some resizing/ enhancements ...
$image->Profile( name=>"sRGB.icm" )
$image->Write("JPEG:newfile.jpg")

But now I also want to strip all profile, IPTC and EXIF info from the image because it will be used for the web and profile/exif info will only increase the size of the image and is not necessary if the profile is srgb.
So I use $image->Strip() before writing the Image But that doesn't work.
It looks like the Profile conversion is only applied to the time the Image is written to the new file.
And if strip is used before that, all profile info is gone.

Is there some way to 'activate' the profile conversion in an earlier state or do I have to reopen the image and apply the strip command and save it again ?.

Kind regards,
Thomas den Braber
Post Reply