Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

core: Add 'default_colorspace' global option to set the default Image…

…Magick colorspace

In some ImageMagick versions, the default "sRGB" color space results
in resized images that are too dark.

The new default_colorspace global config setting allows to override
the color space with another one, like "RGB".

This solution was inspired on the similar fix in Typo3:
http://forge.typo3.org/projects/typo3v4-core/repository/revisions/64f5f361a2468f7352ea505fec90e76733d75c34
  • Loading branch information...
commit bcc12c158696ef4642431da3b23bbe7e3c619857 1 parent 69ac261
@arjan arjan authored
Showing with 4 additions and 1 deletion.
  1. +3 −0  priv/config.in
  2. +1 −1  src/support/z_media_preview.erl
View
3  priv/config.in
@@ -87,6 +87,9 @@
%% Webmachine error handler, you can use your own.
% {webmachine_error_handler,z_webmachine_error_handler},
+ %% Default ImageMagick color space. Some ImageMagick versions (like 6.7.0 and above) use the RGB colorspace, so all images are darker then the original. <br />Possible Values: CMY, CMYK, Grey, HCL, HSB, HSL, HWB, Lab, LCH, LMS, Log, Luv, OHTA, Rec601Luma, Rec601YCbCr, Rec709Luma, Rec709YCbCr, RGB, sRGB, Transparent, XYZ, YCbCr, YCC, YIQ, YCbCr, YUV
+ % {default_colorspace, "sRGB"},
+
% Date this file was created/updated
{modify_date, {{2010,7,12},{12,28,30}}}
].
View
2  src/support/z_media_preview.erl
@@ -166,7 +166,7 @@ cmd_args(FileProps, Filters, OutMime) ->
{correct_orientation, Orientation},
{resize, ResizeWidth, ResizeHeight, is_enabled(upscale, Filters)},
{crop, CropArgs},
- {colorspace, "sRGB"} | Filters1],
+ {colorspace, z_config:get(default_colorspace, "sRGB")} | Filters1],
Filters3 = case {CropArgs,is_enabled(extent, Filters)} of
{none,true} -> Filters2 ++ [{extent, ReqWidth, ReqHeight}];
_ -> Filters2
Please sign in to comment.
Something went wrong with that request. Please try again.