Deprecate DynamicImage::resize method in favor of resize_to_fit
#2645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
resizemethod is confusing because the dimensions of the output image won't necessarily match requested dimensions. This is in contrast toimageops::resizewhich returns an image of precisely the requested size. Deprecating theresizemethod 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
DynamicImageso that the resize methods appear together in the docs.