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

placeholder not showing up for large images #342

Closed
1 of 2 tasks
feinstein opened this issue Mar 3, 2020 · 2 comments
Closed
1 of 2 tasks

placeholder not showing up for large images #342

feinstein opened this issue Mar 3, 2020 · 2 comments
Labels
status: fixed? Bug possibly fixed in latest version.

Comments

@feinstein
Copy link

🐛 Bug Report

When the library downloads a large image that's already on cache, such as:

https://upload.wikimedia.org/wikipedia/commons/3/3f/Fronalpstock_big.jpg

The placeholder won't show.

It shows for the first time, when the image is downloading, but for the second time, when it's fetched from the cache, the screen just goes blank while the image is loading. I don't know the inner mechanics of this, the impression that I have is that the large image is being rendered, so there's nothing on screen, or the image is being loaded on memory.

Since this is a large image, the screen can go blank for 3s.

Again, I suspect this is something between the cache retrieval and the image rendering.

Try this for replication:

CachedNetworkImage(
    height: 60,
    width: 60,
    imageUrl: 'https://upload.wikimedia.org/wikipedia/commons/3/3f/Fronalpstock_big.jpg',
    placeholder: (context, url) => CircularProgressIndicator(valueColor: AlwaysStoppedAnimation<Color>(Colors.red), backgroundColor: Colors.green,),
    errorWidget: (context, url, error) => Icon(Icons.error, color: Colors.red, size: 60,),
)

The first time you load the screen there should be a CircularProgressIndicator, but the second one the screen should go blank for some seconds and then the image will magically appear.

Is this a feature for avoiding showing the placeholder for images on cache? This should work pretty nicely for small images, but bigger ones it won't, maybe have a timer to show the placeholder if loading the image takes longer than 500 milliseconds? Maybe have it as a property so we can set it up?

Expected behavior

The placeholder should be shown until the image isn't loaded for more than 500ms.

Reproduction steps

Configuration

Version: 2.0.0

Platform:

  • 📱 iOS
  • 🤖 Android
@renefloor
Copy link
Collaborator

In the current version the library doesn't keep track of the proces of reading the image from disk. The image you linked is really very large. Mobile phones are still limited in disk space, memory and data usage, especially the cheaper once. I would really recommend to shrink the images before you download them or, if you don't have access to the server, shrink them after downloading.

@renefloor renefloor mentioned this issue Apr 3, 2020
4 tasks
@renefloor
Copy link
Collaborator

In version 2.3.0-beta actually the placeholder fades away only after the image is decoded, so it should be fixed in that version.

@renefloor renefloor added the status: fixed? Bug possibly fixed in latest version. label May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: fixed? Bug possibly fixed in latest version.
Projects
None yet
Development

No branches or pull requests

2 participants