dragonfly
dragonfly copied to clipboard
Dragonfly::ImageMagick::Processors::Thumb::RESIZE_GEOMETRY prevents using ^> resizes
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