-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Glide doesn't loads images in some image views inside a list view #773
Comments
From what you described above I don't see anything obviously wrong with your setup. If you can reproduce this issue consistently (it sounds like you can), add a |
java.lang.RuntimeException: java.io.EOFException
at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:162)
at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:50)
at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:19)
at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:39)
...
Caused by: java.io.EOFException
at com.android.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:95)
at com.android.okhttp.internal.http.HttpConnection$ChunkedSource.readChunkSize(HttpConnection.java:514)
at com.android.okhttp.internal.http.HttpConnection$ChunkedSource.read(HttpConnection.java:495)
at com.android.okio.RealBufferedSource$1.read(RealBufferedSource.java:168) This is the exception which occurs when the image is not being loaded |
From that it looks like the request is being cancelled (but not sure). Can you please provide more info:
|
Hmm, actually square/okhttp#1114 and related issues. Android is using OkHttp built-in, can you please try ot use OkHttp integration to see if that solves your problem? |
android 5.1.1 I used integration library as well but same exception occurs |
Sorry, I meant the code in |
The code in getView is the usual boilerplate code using the viewholder and the imageview is set using the Glide function I mentioned earlier public View getView(int position, View convertView, ViewGroup parent) {
PackageData item = getItem(position);
ViewHolder holder = null;
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.holiday_search_result_item, null);
holder = new ViewHolder(convertView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.packageImage.setImageResource(R.drawable.hotelnoimage);
// this function has the usual Glide function to set an image which i mentioned earlier
UIUtilities.setImageUsingGlide(item.getImage(), holder.packageImage);
return convertView;
} |
That ...
holder = (ViewHolder) convertView.getTag();
}
Glide
.with(holder.packageImage.getContext())
.placeholder(R.drawable.hotelnoimage)
.load(item.getImage())
.into(holder.packageImage)
;
return convertView; |
Also please confirm that this is not true: |
Glide.with(getContext()).load(item.getImages()).placeholder(R.drawable.hotelnoimage).into(holder.packageImage); this has made loading exceptionally slow |
Hmm, and we if we ignore placeholder? So just comment out Is there anything else going on in |
You may be seeing the default crossfade animation as slow. Try adding |
I understand the animation. But the case when EOF exception arises the image does not loads at all but when the getView of the same list view item is called again(by swiping it out of scope and then again swiping into visibility) the image gets loaded |
So we need to prevent that EOF from happening, which we don't know why happens. Please try without placeholder (nor |
Why is the placeholder this slow?? Cant it be faster because it will be helpful in case any exception is occuring |
Based on your responses here's what happens:
Is this correct? Please confirm explicitly, it's hard to go on assumptions. What's your placeholder ( |
Closing this for now, feel free to reopen if you need more help regarding this issue and can provide more infromation. |
W/Glide: Load failed for https://firebasestorage.googleapis.com/v0/b/mfree-9290a.appspot.com/o/placeholder.jpg?alt=media&token=45452c04-e97f-430c-9be2-2b1f31446a50 with size [80x80] what can be the solution? |
@Dipongkar12 Try this Hope this helps |
Hi. I am loading 4 images synchronously and at least one of them is not loaded each tme.
|
I have a list view(implemented using the viewholder pattern) which consists of an image view. There would be around 60-70 items in the list. Now the issue is, if I am scrolling the list at a normal rate everything is okay. But when I swipe up the list view and stop it, image is not loaded in some of the image views. Then when I scroll them up or down , image is loaded in them. This issue is very irritating as ours is a very customer centric app and the product is too much image intensive. Can anyone help??
This is the image view being used in the list view.
And this is how the image is being set
The text was updated successfully, but these errors were encountered: