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

Flutter can't decode this image #14077

Closed
apwilson opened this issue Jan 12, 2018 · 5 comments
Closed

Flutter can't decode this image #14077

apwilson opened this issue Jan 12, 2018 · 5 comments

Comments

@apwilson
Copy link
Contributor

Flutter can't decode this image: http://d3lp4xedbqa8a5.cloudfront.net/s3/digital-cougar-assets/AusGeo/2014/02/12/38296/dugong.jpg

I put the above url in a new Image.network and get the following error:

01-12 12:22:20.423 10690 10707 E flutter : [ERROR:flutter/lib/ui/painting/codec.cc(91)] DecodeImage failed

@apwilson
Copy link
Contributor Author

cc @jason-simmons

@jason-simmons
Copy link
Member

This image is rejected by Skia's GrBackendTextureImageGenerator::Make because its color space returns false for both gammaCloseToSRGB() and gammaIsLinear()

https://github.com/google/skia/blob/master/src/gpu/GrBackendTextureImageGenerator.cpp#L36

The image does decode if the engine uses SkImage::MakeFromEncoded instead of SkImage::MakeCrossContextFromEncoded. I suppose we could fall back to MakeFromEncoded in cases where MakeCrossContextFromEncoded returns null (although that will hurt performance)

@chinmaygarde @brianosman

@brianosman
Copy link

That check is overly restrictive, and can be relaxed. I've got a CL up to do so: https://skia-review.googlesource.com/c/skia/+/94782

hubot pushed a commit to google/skia that referenced this issue Jan 16, 2018
This restriction should have only been enforced in linear-blending mode,
and even then, it's no longer true.

Fixes flutter/flutter#14077

Bug: skia:
Change-Id: Ie0904475e29b213ad7995b8f39c02f6ea7396a9a
Reviewed-on: https://skia-review.googlesource.com/94782
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
@brianosman
Copy link

The Skia fix has been merged into Flutter's engine repo - it should work with the latest engine.

@Hixie Hixie closed this as completed May 24, 2018
@github-actions
Copy link

github-actions bot commented Sep 3, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants