Commit 0a358cec authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Doducment/Image: use sRGB color profile explicitly in converted images.

otherwise Firefox (with default configuration) may display strange colors, especially if the original uses ICC v4 profile.
parent a78fcc79
...@@ -323,7 +323,10 @@ class Image(TextConvertableMixin, File, OFSImage): ...@@ -323,7 +323,10 @@ class Image(TextConvertableMixin, File, OFSImage):
def _resize(self, quality, width, height, format, resolution, frame, crop=False): def _resize(self, quality, width, height, format, resolution, frame, crop=False):
"""Resize and resample photo.""" """Resize and resample photo."""
parameter_list = ['convert', '-colorspace', 'sRGB', '-depth', '8'] icc_profile = os.path.join(os.path.dirname(__file__),
'..', 'misc', 'sRGB.icc')
parameter_list = ['convert', '-colorspace', 'sRGB', '-depth', '8',
'-profile', icc_profile]
if crop : if crop :
parameter_list += '-thumbnail', '%sx%s^' % (width, height),\ parameter_list += '-thumbnail', '%sx%s^' % (width, height),\
'-gravity', 'center',\ '-gravity', 'center',\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment