X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/5e74f498cd2f8d765e309ca52a45a7c2db0a1a6f..83a39529b634c0344a7884d5813e3f7e1a7dbcb4:/vendor/plugins/attachment_fu/lib/geometry.rb diff --git a/vendor/plugins/attachment_fu/lib/geometry.rb b/vendor/plugins/attachment_fu/lib/geometry.rb index 2d6e381..73a7ca2 100644 --- a/vendor/plugins/attachment_fu/lib/geometry.rb +++ b/vendor/plugins/attachment_fu/lib/geometry.rb @@ -25,7 +25,7 @@ class Geometry end # Construct an object from a geometry string - RE = /\A(\d*)(?:x(\d+))?([-+]\d+)?([-+]\d+)?([%!<>@]?)\Z/ + RE = /\A(\d*)(?:x(\d+)?)?([-+]\d+)?([-+]\d+)?([%!<>@]?)\Z/ def self.from_s(str) raise(ArgumentError, "no geometry string specified") unless str @@ -76,7 +76,7 @@ class Geometry 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 @@ class Array geometry = Geometry.from_s(geometry) if geometry.is_a?(String) geometry.new_dimensions_for first, last end -end \ No newline at end of file +end