Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I can't get this to work, so wondering if it is possible.
I have some thumbnails of variable size that I need to fit into a 220 x 220 square. My intention is to display the image at its original size (e.g. 100 x 140), with padding surrounding it and a background colour applied.
If I use the settings below, the image is padded to the left and right but stretched beyond its original size
If I add <AllowUpsizing>false</AllowUpsizing>, then the image is displayed at its original size but with no padding.
Is there anyway to apply padding all the way round an image, and prevent it being upsized?
There's no way to do what you want with ImageGen unfortunately. Padding means you resize to a maximum dimension (220px in your example) while maintaining a proportional resizing of the original image; then any space left over is padded with the background color to make up the full size you requested. By not allowing upsizing you won't get an image bigger than the original even if you request a bigger dimension. So ImageGen is behaving properly, though not in the way you were hoping it might.
Personally, in this case I would use CSS to align and pad the background rather than creating a larger image to download to the website visitor by including the padding in the resized image itself. If the original image needs to be resized (or cropped) I'd use ImageGen for that part, but leave the background padding to CSS.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted