Automatic crop or fit based on origin dimensions
Performs either Crop or Fit depending on the origin image and the desired transformation dimensions.
If the desired image is smaller than the original, the result is cropped to achieve the desired dimensions.
func=cropfit
Original image (650x500 pixels): /samples.scaleflex.com/classroom.jpgarrow-up-right
Cropfit to 500x350: /samples.scaleflex.com/classroom.jpg?func=cropfit&w=500&h=350&bg_color=autoarrow-up-right
Original image (400x250 pixels): /samples.scaleflex.com/ny_doc.jpgarrow-up-right
Cropfit to 500x350: /samples.scaleflex.com/ny_doc.jpg?func=cropfit&w=500&h=350&bg_color=autoarrow-up-right
If you include the Trim operation in the URL, the image will be trimmed first (if possible) and then either cropped or fitted to the desired size.
Original image: /samples.scaleflex.com/sofa.jpgarrow-up-right
Cropfit + trim: /samples.scaleflex.com/sofa.jpg?func=cropfit&trim=0&w=500&h=350&bg_colour=autoarrow-up-right
Last updated 4 months ago