Browse files

Grayscale images

Signed-off-by: Yuri Tomanek <yuri@tomanek.com.au>
  • Loading branch information...
1 parent 883f602 commit c0771c7c0c4a1772cb10a507fa89174c164fecbe @yuritomanek yuritomanek committed Mar 27, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/gluttonberg/library/processor/image.rb
View
3 lib/gluttonberg/library/processor/image.rb
@@ -90,12 +90,13 @@ def generate_image_thumb
#todo
begin
image.resize(suggested_measures(image, config[:geometry]))
- image.arguments << " -gravity Center -crop #{config[:geometry].delete("#")}+0+0 +repage"
+ image.arguments << " -gravity Center -crop #{config[:geometry].delete("#")}+0+0 +repage #{config[:grayscale] && config[:grayscale] == true ? "-colorspace Gray":""}"
rescue => e
puts e
end
else
image.resize config[:geometry]
+ image.arguments << "-colorspace Gray" if config[:grayscale] && config[:grayscale] == true
end
image.save File.join(asset.tmp_directory, file_name)
asset.move_tmp_file_to_actual_directory(file_name, true)

0 comments on commit c0771c7

Please sign in to comment.