Thumb() and IPTC copyright-infos & color-profiles

Is there an way to configure the thumb() function for keeping the copyright-informations & the color-profiles?

Thanks in advance

Solved. I wrote my own thumb driver.

May you share, what library you have used for that purpose or how you solved this?
Would be very interesting, because I also work on an advanced thumbnail generator for kirby with a strong focus on responsive design and the picture element. Keeping color profiles could be an interesting addition to my plugin.

1 Like

Hi Fabian,

remove the »-strip« command to include color profiles.

I just want to add something…
I use $command[] = ‘-thumbnail’;
instead of -resize (line 291 in thump.php) and -strip (line 277).

-thumbnail keeps the color profiles and delete everything else
-strip deletes everything… color profiles, IPTC profiles, EXIF, comments

1 Like

Thank you for this but I still have a problem.

Removing the line -strip helps to keep the right colors but changing -resize to -thumbnail breaks the code and all the thumbnails are generated as the original file in HD.

You mean that the images are not resized?
Could you please put this line at the end of your thumb driver and post the output here:

var_dump(implode(' ', $command));

What would also help is the output of convert --version on the command line.

BTW… which IM version do you use?

Because before IM v6.5.4-7 the “-thumbnail” command would strip ALL profiles from the image, including the ICC color profiles. From this version onward the color profiles will be preserved.

The best option I found to keep at best the colors of the images when resizing it is the following :

  1. Convert all the images in sRGB color profile
  2. Remove the line “-strip” (line 277 in thump.php)

I created an issue for this problem that color profiles are removed from thumbs.

1 Like

This is great, thank you.