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

Add the ability to set debugLabel #973

Open
2 tasks
kardenwork opened this issue Sep 24, 2024 · 0 comments
Open
2 tasks

Add the ability to set debugLabel #973

kardenwork opened this issue Sep 24, 2024 · 0 comments

Comments

@kardenwork
Copy link

kardenwork commented Sep 24, 2024

🏗 Enhancement Proposal

Add the ability to set debugLabel for ImageInfo's produced by MultiImageStreamCompleter.

Pitch

In Flutter, you can set debugInvertOversizedImages which, if set to true, triggers a throw of a FlutterException which has a following text:

Image $debugImageLabel has a display size of $outputWidth×$outputHeight but a decode size of ${image.width}×${image.height}, which uses an additional ${overheadInKilobytes}KB (assuming a device pixel ratio of $maxDevicePixelRatio).

As you can see, it uses debugImageLabel as image indicator for debug. This debugImageLabel is a debugLabel from ImageInfo class. But when MultiImageStreamCompleter from this library emits new ImageInfo object, it completely ignores debugLabel argument, which always results in it being equal to null, which, in case of multiple simultaneously resizing images, makes it impossible to detect the problematic image.

  • Q: Why would you need debug label if image is inverted by "debugInvertOversizedImages" flag?
  • A: Because during the rapid resizing animations, there might be the case when exception is thrown in the middle of the animation, but at the end, everything returns to normal and image is not inverted anymore.

In order to implement this, MultiImageStreamCompleter must receive debugLabel (or debugLabelCallback with some info passed to it) from above (the origin being CachedNetworkImage and CachedNetworkImageProvider) and pass it to all _emitFrame calls inside of it.

Platforms affected (mark all that apply)

  • 📱 iOS
  • 🤖 Android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant