Image Embedded Color Profile

Not sure if this showed up somewhere else (the search terms, color profile embedded return unassociated results… :slight_smile: ).

I run a Free Software photography forum over at As you might imagine, we have users that are very particular about how their images are displayed.

One thing we ran into recently was problems on a thread about color management:

One of the photographers noticed that the functionality of fetching linked images and storing them locally seems to strip the color information from the images. While this may be fine to save space on most forums, for a photography forum this is a bit painful. :frowning:

To illustrate, this image has a rotated embedded color profile. It should show (Rot = Red, Grün = Green, Blau = Blue):

The source image I embedded in the post above can be found here:

Here is the same image, uploaded directly to the forum:

Is the image processing being done with imagemagick? If so, is there any thought to possibly adding an option to convert uploaded image to sRGB and to tag them as such before saving?

(I’d be happy to investigate further if someone could point me to the relevant bits of code that handle image conversion when uploaded?)


Sure check with @zogstrip.

@zogstrip - is the conversion being done using imagemagick? If so, would you mind pointing me to the relevant section?

It appears that we may only need an option to convert any images to sRGB if they have a different profile embedded, and then either strip the profile or specify that the image is now sRGB.

We do the resizing with convert but then the thumbnail is optimised using optipng.

You will find everything you need to know in OptimizedImage and more specifically


Tested fix:


This still does not look fixed to me… I just tried with the image on the OP.

@tgxworld as part of your image magick 7 upgrade can you test this?


This is actually a result of ImageOptim and not ImageMagick. We probably don’t want to be stripping the ICC profile here?

  • :strip — List of extra markers to strip: :comments , :exif , :iptc , :icc or :all (defaults to :all )

Probably :comments is what we want there?

1 Like

I was thinking about this and this seems very specific to a photography forum. If they want to keep all the metadata/color profile, they can just set SiteSetting.strip_image_metadata to false. For majority of the images, keeping the exif or iptc metadata isn’t going to be very useful.


Interesting @Patrick_David, so this is not really a bug… it is a feature request to allow for fidelity when stripping exif tags (or simply misunderstanding an existing feature)

I am going to close this for now, but feel free to open a new topic if you find setting strip_image_metadata to false unacceptable.