So I have a question I am doing some resizing and...
# cfml-general
g
So I have a question I am doing some resizing and I have some images whose width and height is different to end up in proportion I can keep the height empty and width specifications so it does it automatically But sometimes I have to keep both width and height in that case how can fix the issue of images not being squeezed and they should do it properly Do scaling will Work If that is not the way do I need to actually design the cropping section manually
m
imageScaleToFit() or using imageResize(), leaving the side that should be auto calculated blank, usually I opt for imageScaleToFit() because it is simpler
d
When you say you "have to keep both width and height", what exactly do you want to happen? If you want scaling as big as possible, treating the passed width and height as maximums, then see @Matt Jones's answet. If you want the img to be cropped, you need to think through the scale of of the image within that cropped area, and apply imageResize() then imageCrop().