Permalink
Browse files

Fix resizing of images with a height much bigger than with (or revers…

…e). Minimum size is 1 pixel
  • Loading branch information...
1 parent 7bcd58b commit 42a37fab15c6d1dacc6043ee40b25de12b63ac04 Sergio committed Oct 31, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/geometry.rb
View
4 lib/geometry.rb
@@ -76,7 +76,7 @@ def new_dimensions_for(orig_width, orig_height)
new_height = orig_height if @flag && orig_height.send(@flag, new_height)
end
- [new_width, new_height].collect! { |v| v.round }
+ [new_width, new_height].collect! { |v| [v.round, 1].max }
end
end
@@ -90,4 +90,4 @@ def /(geometry)
geometry = Geometry.from_s(geometry) if geometry.is_a?(String)
geometry.new_dimensions_for first, last
end
-end
+end

0 comments on commit 42a37fa

Please sign in to comment.