Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Grayscale images

Signed-off-by: Yuri Tomanek <yuri@tomanek.com.au>
  • Loading branch information...
commit c0771c7c0c4a1772cb10a507fa89174c164fecbe 1 parent 883f602
@yuritomanek yuritomanek authored
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)
Please sign in to comment.
Something went wrong with that request. Please try again.