I'm using paperclip gem to resize images. The issue is that resized images are "dark". I attached two examples of the original image and the resized one.
Here is the code generating images :
has_attached_file :result,
:styles => {
:medium => { :geometry => '262' },
},
:hash_secret => "xxx",
:url => "/system/:class/:attachment/:id_partition/:style/:hash.:extension",
:hash_data => ":class/:attachment/:style/:id"
validates_attachment :result, :content_type => { :content_type => /\Aimage\/.*\Z/ }
I can see this line in the log :
Command :: convert '/tmp/xxx.png[0]' -auto-orient -resize "262" '/tmp/xxx20150110-9669-z4rtiy'
Trying adding -colorspace sRGB
into your convert
command like this to force the colorspace:
convert input.png -resize 262 -colorspace sRGB output.png
Your command works fine on my (very current) version of ImageMagick as is, but if I put -colorspace RGB
it comes out dark here too. I believe the default colorspace changed in recent versions of IM.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments