ExifTool Forum

ExifTool => The Image::ExifTool API => Topic started by: erixon on November 22, 2012, 11:27:23 AM

Title: Preserve ICC-profile
Post by: erixon on November 22, 2012, 11:27:23 AM
Thanks for a great tool.

I'm using ImageMagick to create JPG-thumbnails but having the problem with strip() which removes the color-profile-data and makes the images dull.

Instead I should be able to fix this through ExifTool.

I guess it's this I want to do but in Perl?
exiftool -all= --icc_profile:all thumbnail.jpg

Is ICC-profile the only thing I need to preserve?

It sounds like a quite simple task but I'm not have been able to do a working Perl code.

kind regards
Tomas
Title: Re: Preserve ICC-profile
Post by: Phil Harvey on November 22, 2012, 01:52:19 PM
Hi Tomas,

Yup, that's the command.

From the API it is done just like this example in the documentation:

# delete all but EXIF tags
$exifTool->SetNewValue('*');  # delete all...
$exifTool->SetNewValue('EXIF:*', undef, Replace => 2); # ...but EXIF


Except that you specify 'ICC_Profile:*' instead of 'EXIF:*'.  ('ICC_Profile:all' will also work)

- Phil

Edit: Fixed spelling of your name... sorry.
Title: Re: Preserve ICC-profile
Post by: erixon on November 23, 2012, 04:19:48 AM
Ok thanks, it seems to work

my $et = new Image::ExifTool();
$et->SetNewValue("*");
$et->SetNewValue("ICC_Profile:*" undef, Replace => 2);
$et->WriteInfo($original_file, $thumbnail_file);

/Tomas