dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Dragonfly::ImageMagick::Processors::Thumb::RESIZE_GEOMETRY prevents using ^> resizes

Open nicops opened this issue 9 years ago • 0 comments
trafficstars

The issue is basically that 500x500^> and similar resizes are not catched by the regex, but it's actually a valid resize according to imagemagick (it means: "attempt to fill area while preserving width & height ratio, but never enlarge, only shrink").

For now in my project what I did is monkeypatching the constant so

RESIZE_GEOMETRY         = /\A\d*x\d*[><%^!]?\z|\A\d+@\z/

is replaced with

RESIZE_GEOMETRY         = /\A\d*x\d*[><%^!]*\z|\A\d+@\z/

basically I simply changed the ? for a * althought it might not be a size fits all solution

nicops avatar Jun 02 '16 15:06 nicops