Cropfit
Automatic crop or fit based on origin dimensions
Last updated
Automatic crop or fit based on origin dimensions
Last updated
©2024 Scaleflex SAS
Performs either or operation 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): /docs/classroom.jpg
Cropfit to 500x350: /docs/classroom.jpg?func=cropfit&w=500&h=350&bg_color=auto
Original image (400x250 pixels): /docs/ny_doc.jpg
Cropfit to 500x350: /docs/ny_doc.jpg?func=cropfit&w=500&h=350&bg_color=auto
If you include the operation in the URL, the image will be trimmed first (if possible) and then either cropped or fitted to the desired size.
Original image: /docs/sofa.jpg
Cropfit + trim: /docs/sofa.jpg?func=cropfit&trim=0&w=500&h=350&bg_colour=auto