Michael
2015-11-27 11:56:26 UTC
Also to then fill the space at either the top/bottom or left/right (depending on the orientation of the image if width or height is longer) with a solid color.
Eg I have a lot of images that are anywhere from 800-1500 pixels along he longest length and I need to proportionally resize them to fit within a space that is 200 x 200 square and portrait images will have color to the left and right to fill in the gap and landscape images will have the color top and bottom to fill the gap, this will make the image itself always be 200 x 200 pixels.
This will be used within a php script that will dynamically generate a table of images 3 columns wide by 6 rows high, which will be then copied to use within an email