Skip to content

Commit

Permalink
Fix resizing of images with a height much bigger than with (or revers…
Browse files Browse the repository at this point in the history
…e). Minimum size is 1 pixel
  • Loading branch information
Sergio committed Oct 31, 2008
1 parent 7bcd58b commit 42a37fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/geometry.rb
Expand Up @@ -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

Expand All @@ -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.