Skip to content
Browse files

when making thumbnails don't mess with the aspect ratio. instead cent…

…er them on a white background
  • Loading branch information...
1 parent 94c17aa commit 8bfbd6cf89f519fd113d11cd537dde002262c7a0 @phallstrom committed
Showing with 2 additions and 1 deletion.
  1. +1 −0 TODO
  2. +1 −1 lib/el_finder/image.rb
View
1 TODO
@@ -0,0 +1 @@
+- Complain if root directory is missing.
View
2 lib/el_finder/image.rb
@@ -20,7 +20,7 @@ def self.resize(pathname, options = {})
def self.thumbnail(src, dst, options = {})
return nil unless File.exist?(src)
- system( ::Shellwords.join(['convert', '-resize', "#{options[:width]}x#{options[:height]}!", src.to_s, dst.to_s]) )
+ system( ::Shellwords.join(['convert', '-resize', "#{options[:width]}x#{options[:height]}", '-background', 'white', '-gravity', 'center', '-extent', "#{options[:width]}x#{options[:height]}", src.to_s, dst.to_s]) )
end # of self.resize
end # of class Image

0 comments on commit 8bfbd6c

Please sign in to comment.
Something went wrong with that request. Please try again.