With dragonfly I can do the following:
image.thumb('300x300#')
Which will resize the image, maintaining aspect ratio and cropping it centrally (effectively chopping off the ends of the longest edge).
However, if the image has an edge smaller than 300px, then it is scaled upwards. What I would prefer is that in this case the image is not resized, but instead white padding is added where necessary.
So basically, if both edges are 300px or over I want the normal behaviour from 300x300#
, but if any edge is smaller than 300px, then the image is not resized at all, but still cropped to 300x300 with whitespace added where necessary.
Is this possible with either of Dragonfly's built in processors (#thumb
or #convert
? Or do I need to build my own processor? If so, what sort of imagemagick commands do I need to be looking at?