Ruby on rails 回形针(imagemagick)生成暗图像

Ruby on rails 回形针(imagemagick)生成暗图像,ruby-on-rails,imagemagick,paperclip,Ruby On Rails,Imagemagick,Paperclip,我正在使用回形针宝石调整图像大小。 问题是,调整大小的图像是“暗的”。我附上了两个原始图像和调整大小的一个例子 以下是生成图像的代码: has_attached_file :result, :styles => { :medium => { :geometry => '262' }, }, :hash_secret => "xxx", :url => "/system/:class/:attachment/:id_partition/:sty

我正在使用回形针宝石调整图像大小。 问题是,调整大小的图像是“暗的”。我附上了两个原始图像和调整大小的一个例子

以下是生成图像的代码:

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/ }
我可以在日志中看到这一行:

Command :: convert '/tmp/xxx.png[0]' -auto-orient -resize "262" '/tmp/xxx20150110-9669-z4rtiy'


尝试将
-colorspace sRGB
添加到
convert
命令中,如下所示以强制使用颜色空间:

convert input.png -resize 262 -colorspace sRGB output.png
您的命令在我(最新)版本的ImageMagick上正常工作,但如果我将
-colorspace RGB
放在这里,它也会变暗。我相信在IM的最新版本中默认的颜色空间已经改变了