Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider removing the ImageDecoderRect trait #2355

Open
Shnatsel opened this issue Oct 17, 2024 · 2 comments
Open

Consider removing the ImageDecoderRect trait #2355

Shnatsel opened this issue Oct 17, 2024 · 2 comments
Labels
kind: API missing or awkward public APIs next: breaking Information tag for PRs and ideas that require an interface break

Comments

@Shnatsel
Copy link
Contributor

The ImageDecoderRect trait is supposed to help decode only the specified part of the image, as opposed to the entire thing.

As of v0.25, only BMP and Farbfeld decoders implement it: https://docs.rs/image/0.25.4/image/trait.ImageDecoderRect.html

Given the lack of format support, it's probably best to remove it for now, to reduce the API surface and maintenance burden. We could possibly re-introduce it later if there is enough demand.

@Shnatsel
Copy link
Contributor Author

FWIW imagemagick does provide this functionality, so a proper implementation of this could potentially be of use to wondermagick. But it is only an optimization, ideally and we'd have to generalize it to animations as well, so I don't think it's worth the trouble at this stage.

@Shnatsel Shnatsel added next: breaking Information tag for PRs and ideas that require an interface break kind: API missing or awkward public APIs labels Oct 17, 2024
@fintelia
Copy link
Contributor

I think this is worth considering. Part of the problem with ImageDecoderRect is there's formats were it is sometimes possible to extract portions of the image, but it depends on the choices made by the encoder.

If we do decide to remove, thing thing to do would be marking the trait as deprecated for a few releases and see if any concerns are raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: API missing or awkward public APIs next: breaking Information tag for PRs and ideas that require an interface break
Projects
None yet
Development

No branches or pull requests

2 participants