imazen / imageflow-dotnet

The official .NET API for Imageflow, the Rust image processing and optimization engine for web servers
GNU Affero General Public License v3.0
143 stars 25 forks source link

Changing format and providing maxHeight/maxWidth without height/width changes image size #48

Closed aheintz closed 7 months ago

aheintz commented 1 year ago

We're using ImageFlow with command-string, and the query string maxHeight=3200&maxWidth=3200&scale=both&format=png&up.filter=cubic&down.filter=cubic&f.sharpen=1 scales the image to fit within 3200x3200.

If I remove maxHeight and maxWidth or scale=both the original image size is retained.

If I don't provide a height or width, I think the expected result should be an image that maintains the size of the original.

Tested on 0.10.0.

lilith commented 1 year ago

I assume the original image is less than 3200x3200?

Maxwidth/maxheight are more or less deprecated, and equivalent to w=3200&h=3200&mode=max

Scale=both causes upscaling; scale=down is the default. Mode=max keeps aspect ratio and fits to the bounds, mode=crop crops to the aspect ratio.

When you combine scale=both and mode=max, images will be upscaled to reach the lesser of the two bounds while maintaining aspect ratio.

On Wed, Jun 28, 2023, 3:50 AM Anders Heintz @.***> wrote:

We're using ImageFlow with command-string, and the query string maxHeight=3200&maxWidth=3200&scale=both&format=png&up.filter=cubic&down.filter=cubic&f.sharpen=1 scales the image to fit within 3200x3200.

If I remove maxHeight and maxWidth or scale=both the original image size is retained.

If I don't provide a height or width, I think the expected result should be an image that maintains the size of the original.

Tested on 0.10.0.

— Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow-dotnet/issues/48, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH66J7MAVDNLFCYDYEDXNP45DANCNFSM6AAAAAAZWZ55N4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>