Assigned
Status Update
Comments
vi...@google.com <vi...@google.com> #2
It looks like you are raising an issue as an Android user, rather than an Android Open Source Developer.
For user support, please see the
For Pixel phone support, please see the
Support for other devices is provided by the device manufacturers or by the carriers selling those devices,
Description
ImageDecoder
allows callers, viaOnHeaderDecodedListener
, to make decisions based on the decoded metadata of an image. By this point, however, callers of the API have already committed to decoding the image, but they may choose to go a different route based on the information received. To solve this, I'd like to see support inImageDecoder
for decoding just the metadata of an image.A use case for this is to handle images that exceed the devices max texture size. The documentation details one possible way to handle this case, by adjusting the sample size of the decoder to decode a degraded image, but an equally valid alternative could be to halt image decoding and instead load the image using a
BitmapRegionDecoder
to display the image in a tiled manner, in order to maintain image fidelity.With the current implementation of
ImageDecoder
, the only way to achieve that would be to attempt to decode the image and throw an exception in theOnHeaderDecodedListener
if the image exceeds your threshold for subsampling, which you'd then have to catch to branch into your subsampling approach.