by LukeLambert · 3y ago · 0 comments
I believe all resizing operations a user might realistically want can be achieved with three parameters: width, height, and crop. Additional x and y parameters (floats between 0.0 and 1.0) could be used for setting the focal point of the crop box.
Examples:
source.jpg?width=400
Iff source width is greater than 400px, scale down to 400px wide. source.jpg?height=300
Iff source height is greater than 300px, scale down to 300px high. source.jpg?width=400&height=300
Iff source width is greater than 400px or source height is greater than 300px, scale down to fit within a 400px by 300px box. source.jpg?width=400&height=300&crop=true
Crop source to a 4x3 aspect ratio. Iff result is larger than 400px by 300px, scale down.No comments yet.