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

This issue occured #269

Closed
cgowthamanmca opened this issue Oct 17, 2019 · 7 comments
Closed

This issue occured #269

cgowthamanmca opened this issue Oct 17, 2019 · 7 comments

Comments

@cgowthamanmca
Copy link

Exception: Could not instantiate image codec.
I/flutter (11177):
I/flutter (11177): When the exception was thrown, this was the stack:
I/flutter (11177): #0 _futurize (dart:ui/painting.dart:4134:5)
I/flutter (11177): #1 instantiateImageCodec (dart:ui/painting.dart:1669:10)
I/flutter (11177): #2 ScaledFileImage._loadAsync (package:cached_network_image/src/scaled_file_image.dart:61:18)
I/flutter (11177):
I/flutter (11177): #3 ScaledFileImage.load (package:cached_network_image/src/scaled_file_image.dart:47:14)
I/flutter (11177): #4 ImageProvider.resolve... (package:flutter/src/painting/image_provider.dart:316:48)
I/flutter (11177): #5 ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:160:22)
I/flutter (11177): #6 ImageProvider.resolve.. (package:flutter/src/painting/image_provider.dart:316:25)
I/flutter (11177): #7 SynchronousFuture.then (package:flutter/src/foundation/synchronous_future.dart:38:29)
I/flutter (11177): #8 ImageProvider.resolve. (package:flutter/src/painting/image_provider.dart:313:11)
I/flutter (11177): #12 ImageProvider.resolve (package:flutter/src/painting/image_provider.dart:305:16)
I/flutter (11177): #13 _ImageState._resolveImage (package:flutter/src/widgets/image.dart:951:20)
I/flutter (11177): #14 _ImageState.didChangeDependencies (package:flutter/src/widgets/image.dart:908:5)
I/flutter (11177): #15 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4086:12)
I/flutter (11177): #16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
I/flutter (11177): #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
I/flutter (11177): #18 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
I/flutter (11177): #19 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
I/flutter (11177): #20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
I/flutter (11177): #21 Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
I/flutter (11177): #22 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4910:32)
I/flutter (11177): #23 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:5243:17)
I/flutter (11177): #24 Element.updateChild (package:flutter/src/widgets/framework.dart:2893:15)
I/flutter (11177): #25 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3961:16)
I/flutter (11177): #26 Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
I/flutter (11177): #27 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2348:33)
I/flutter (11177): #28 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:760:20)
I/flutter (11177): #29 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:280:5)
I/flutter (11177): #30 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1033:15)
I/flutter (11177): #31 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:975:9)
I/flutter (11177): #32 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:891:5)
I/flutter (11177): #36 _invoke (dart:ui/hooks.dart:249:10)
I/flutter (11177): #37 _drawFrame (dart:ui/hooks.dart:207:3)
I/flutter (11177): (elided 6 frames from package dart:async)
I/flutter (11177):
I/flutter (11177): Path:
I/flutter (11177): /data/user/0/com.girlsourced/cache/libCachedImageData/c2dbfbc0-f0be-11e9-b656-ad033e7623b7.html;
I/flutter (11177): charset=UTF-8
I/flutter (11177): ════════════════════════════════════════════════════════════════════════════════════════════════════

@renefloor
Copy link
Contributor

What's the url you tried?
.../libCachedImageData/c2dbfbc0-f0be-11e9-b656-ad033e7623b7.html this looks like you didn't try to download an image but an html page.

@gowtham2809
Copy link

@renefloor We used the following url - https://c.cfjump.com/Products/33681/72414727.jpg

@renefloor
Copy link
Contributor

When I try to load that exact url it just loads perfectly fine, so I don't know what is going wrong. Maybe you once had a 404 page which returned a 200 with an html page instead of a 404 or something like that and than the page is cached.

@gowtham2809
Copy link

@renefloor Yeah, there are some chances for that to happen. The image is being hosted behind a CDN like Cloudflare which is returning an HTML to check the caller. Something like this.
image

Will this library be able to handle that?

@wsakka
Copy link

wsakka commented Oct 20, 2019

@gowtham2809 and @cgowthamanmca , there is no image library built to handle this situation (it's not an HTTP redirect). Image assets should be stored at a proper CDN like S3, especially when you have CloudFlare's DDOS protection enabled.

@nsttu
Copy link

nsttu commented Dec 4, 2019

What's the url you tried?
.../libCachedImageData/c2dbfbc0-f0be-11e9-b656-ad033e7623b7.html this looks like you didn't try to download an image but an html page.

@renefloor Do you have a suggestion how to handle the sitiuation when you don't know if the url really returns image data. If there is something wrong with the response I would expect the errorWidget to be loaded.

@renefloor
Copy link
Contributor

Duplicate of #320

@renefloor renefloor marked this as a duplicate of #320 Feb 21, 2020
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

5 participants