image icon indicating copy to clipboard operation
image copied to clipboard

Deprecate `DynamicImage::resize` method in favor of `resize_to_fit`

Open fintelia opened this issue 3 months ago • 1 comments

The resize method is confusing because the dimensions of the output image won't necessarily match requested dimensions. This is in contrast to imageops::resize which returns an image of precisely the requested size. Deprecating the resize method and replacing it with an alternative makes the distinction clearer, though I'm open to alternative naming ideas.

I'll also say that if we didn't already have two methods to preserve aspect ratio while resizing an image, I probably won't support adding them. Given an exact resize method, building these other operations is a bit tricky but not something that necessarily needs to be in this crate. However since folks are already using them, the churn/disruption probably isn't worth it.

This PR also reorders some methods on DynamicImage so that the resize methods appear together in the docs.

fintelia avatar Nov 13 '25 02:11 fintelia

I went ahead and resolved the conflicts I caused by merging #2639

I've outright deleted resize because the signature changed and people would have to edit the code anyway.

This should be good to go after a cargo fmt

Shnatsel avatar Nov 18 '25 20:11 Shnatsel