Merged
Conversation
The argument is summarized in #2355 already. The details about the misfit is expanded on in <#2481 (comment)>. The main part of its implementation is spent on policy working around the underlying decoder not really cropping by itself and still yielding all the data. In this sense it is more like the antipole to what the trait really should be. That is of course part of the issue with the trait; none of our implementations provide the real benefit over the naive 'throw-away-data' strategy and that happens by them using what is, really, a pitfall to be quite frank. You really should not be using this except in the circumstance that you can't avoid it. And performant decoding, in general, should not work by 'scanlines' (apart from png where the filter/compression depends on this concept and hence the previous line is always necessary). This held true for both of the removed decoder bindings. In BMP it is quite suspiciously so as that format is meant to be mmap'd—wasting lots and lots of energy. Let's face the reality that most of our users call into ImageReader and do not interact with the trait system directly—the static extension point also make it impossible to fit into as an optional path way into ImageReader since it is built around boxing and type erasing the underlying decoder early.
12ae464 to
7cda3e7
Compare
fintelia
approved these changes
Nov 30, 2025
Contributor
fintelia
left a comment
There was a problem hiding this comment.
Sounds good to me.
And if we do decide on something like a default-implemented method on ImageDecoder for adding back similar functionality, it won't be semver breaking so it is fine to land post-1.0 release.
Shnatsel
added a commit
to Shnatsel/jxl-oxide
that referenced
this pull request
Jan 17, 2026
Upstream `image` will remove this trait in the next major release due to lack of both implementors and users: image-rs/image#2681 I'm opening this PR now, ahead of the next `image` release, so that I could depend on `image` from git in my project and still be able to decode JPEG XL files.
tirr-c
pushed a commit
to tirr-c/jxl-oxide
that referenced
this pull request
Jan 25, 2026
Upstream `image` will remove this trait in the next major release due to lack of both implementors and users: image-rs/image#2681 I'm opening this PR now, ahead of the next `image` release, so that I could depend on `image` from git in my project and still be able to decode JPEG XL files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 argument is summarized in #2355 already. The details about the misfit is expanded on in #2481 (comment).
This held true for both of the removed decoder bindings. In BMP it is quite suspiciously so as that format is meant to be mmap'd—but the called utility reads every single byte regardless, wasting lots and lots of energy. We did not get complaints about such behavior but do get some for inefficient other operations. Let's face the reality that most of our users call into ImageReader and do not interact with the trait system directly—the static extension point also make it impossible to fit into as an optional path way into ImageReader since it is built around boxing and type erasing the underlying decoder early.
Closes: #2355
Restricting the viewport before a readout is one of the interactions I had in mind for the reader type in #2672. I'll come up with a defaulted method in
ImageDecoderinstead. Since the trait is misbehaved regardless that is a separate matter from removing it, to me.