I'm using the answer to this question:
Insert one image into another using convert
However, I am not in control over the aspect ratio of the input image, so it does not exactly fit in the destination (whose size is also variable, but I am in control of that).
By default, ImageMagic makes the image smaller:
- Let's say I want to put the image into a 300x200 destination (because I can choose that one).
- This works if I get a 600x400 image.
- X But if I get a 250x200 image (or equivalently 500x400), then there are bars on the left and right.
- X And if I get a 300x250 image (or equivalently 600x500), then there are bars on the top and bottom.
I see when this might be desirable, but I want the destination being fully covered.
- So if I get a 250x200 image as input, I want it to be scaled to 300x400.
- And if I get a 300x250 image as input, I want it to be scaled to 375x300.
Put differently:
- When maintaining aspect ratio, ImageMagic makes sure that no dimension is larger than the intended size.
- I want to make sure that no dimension is smaller than the intended size.



I was simply asking if ImageMagick has a possibility to preserve aspect ratio by overflowing instead of the default underflowing, but apparently it does not.
So the answer is no, it's not possible (out of the box, so I have to write a script to do the calculations).