Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Image Load Speed Much more Lower than NetworkImage #119

Closed
lucasjinreal opened this issue Jul 27, 2019 · 11 comments
Closed

Image Load Speed Much more Lower than NetworkImage #119

lucasjinreal opened this issue Jul 27, 2019 · 11 comments
Labels

Comments

@lucasjinreal
Copy link

I have some comparation, when a image is big, advanced_networkimage always failed to load image (actually it keep try accesing my image from cloud, but not continuely loading just somewhat corrupt loading and then start it over again failing at last).

But NetworkImage can load image success eventually and much more faster than this lib.

Such as this image

http://loliloli.pro:9000/uploads/chat/groups/avatar/grpwjTe5WsQI3.jpg

Since the image is big, then it will fail load , this is terrible, and it is slower than NetworkImage

@mchome
Copy link
Owner

mchome commented Jul 28, 2019

Please provide version info.

@lucasjinreal
Copy link
Author

  flutter_advanced_networkimage: ^0.5.0

@mchome
Copy link
Owner

mchome commented Jul 28, 2019

I don't see any problems with your url, can you post the code about comparation?

@lucasjinreal
Copy link
Author

@mchome Not url, the image can be shown, but very slow. NetworkImage can show, but AdvancedNetwork sometime fail and can not show image.

if (userAvatarUrl != null && userAvatarUrl != '') {
      // userAvatarImage = AdvancedNetworkImage(userAvatarUrl);
      userAvatarImage = NetworkImage(userAvatarUrl);
    } else {
      userAvatarImage = AssetImage('assets/images/blank_avatar.png');
    }

I am using this widget in a data model:

class Group {
  Group({
    @required this.group_avatar,
    @required this.group_name,
    @required this.group_desc,
    @required this.group_create_time,
    @required this.group_create_timestamp,
    @required this.group_addr,
    this.group_members_num,
    this.groupAvatarImage,
    this.isOwner,
    this.group_avatar_url
  });

  final String group_avatar;
  final String group_avatar_url;
  final String group_name;
  final String group_desc;
  final String group_create_time;
  final String group_create_timestamp;
  final String group_addr;
  int group_members_num;
  bool isOwner;
  ImageProvider groupAvatarImage;

@AlaaEldeenYsr
Copy link

you should set the retryLimit to the biggest number as possible
AdvancedNetworkImage(imgUrl, retryLimit: Duration.secondsPerDay)
also set the retryDurationFactor to zero
and the retryDuration is set to Duration(milliseconds: 500) by default no need to be changed.

@ghost
Copy link

ghost commented Sep 13, 2019

Hello? How does preProcessing work in AdvancedNetworkImage?
My data url from map is so lazy before appearing in my return container and i would like to show the image before caching it to avoid Failed cache. Thank in advance.

@lucasjinreal
Copy link
Author

extend_image would be better

@mchome mchome added the wontfix label Sep 13, 2019
@ghost
Copy link

ghost commented Sep 13, 2019

Thank you @jinfagang!

@mchome
Copy link
Owner

mchome commented Sep 13, 2019

@SirBlank preProcessing was for someone who want to manipulate the image(e.g. bluring) before caching. I think you'd better using futurebuilder for lazy data.

@ghost
Copy link

ghost commented Sep 13, 2019

I think , Instead of using extend_image, it would be better use the fallbackAssetImage and fallbackImage from AdvanceNetworkImage. what I'm trying to achieve is that the data from url will display before catching. anyway thank you again :)

@ghost
Copy link

ghost commented Sep 13, 2019

@mchome Thank you sir! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants