Skip to content

Conversation

AlexV525
Copy link

@AlexV525 AlexV525 commented Nov 3, 2024

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

This is a bug fix. Fixes #973

This also helps to display the info in the Flutter Inspector.

As a reference, this is how the MultiFrameImageStreamCompleter implements the debugLevel.
https://github.com/flutter/flutter/blob/574b7e765d86f3f70eac8817a2906ac3099c0bf9/packages/flutter/lib/src/painting/image_stream.dart#L967

⤵️ What is the current behavior?

======== Exception caught by painting library ======================================================
The following message was thrown while painting an image:
Image null has a display size of 794×529 but a decode size of 1956×1280, which uses an additional 10849KB (assuming a device pixel ratio of 2.625).

Consider resizing the asset ahead of time, supplying a cacheWidth parameter of 794, a cacheHeight parameter of 529, or using a ResizeImage.

🆕 What is the new behavior (if this is a feature change)?

======== Exception caught by painting library ======================================================
The following message was thrown while painting an image:
Image https://example.com/redact.jpeg has a display size of 794×529 but a decode size of 1956×1280, which uses an additional 10849KB (assuming a device pixel ratio of 2.625).

Consider resizing the asset ahead of time, supplying a cacheWidth parameter of 794, a cacheHeight parameter of 529, or using a ResizeImage.

💥 Does this PR introduce a breaking change?

No.

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

Successfully merging this pull request may close these issues.

Add the ability to set debugLabel
1 participant