Glide Version: 4.0.0-RC1 (also tried 3.7.0 and 3.8.0)
Integration libraries: No
Device/Android Version: Nexus 5 (6.0.1), Galaxy S5 (6.0.1), Galaxy S4 (5.0.1) and other Galaxy phones.
Issue details / Repro steps / Use case background:
Glide load line / GlideModule (if any) / list Adapter code (if any):
GlideApp.with(this).
load("https://od.lk/s/121195309_xa4Rd/Cover.jpg").
listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target,
boolean isFirstResource) {
if (e != null) {
Log.d("glideexeception", e.getMessage());
e.printStackTrace();
}
return false;
}
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target,
DataSource dataSource, boolean isFirstResource) {
return false;
}
}).
into(mTestImg);
However, this image (https://od.lk/s/121195309_xa4Rd/Cover.jpg) works perfectly in Picasso with this one-liner:
Picasso.with(this).
load("https://od.lk/s/121195309_xa4Rd/Cover.jpg").
into(mTestImg);
So I think that this is a Glide issue.
Here are some other image files which Glide fails to load:
Layout XML:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/testimg"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
Stack trace / LogCat:
07-12 13:35:35.556 31296-31296/? I/art: Late-enabling -Xcheck:jni
07-12 13:35:35.575 31296-31302/? I/art: Debugger is no longer active
07-12 13:35:35.598 31296-31296/? W/System: ClassLoader referenced unknown path: /data/app/com.yenks.glidenewtimeout-2/lib/arm
07-12 13:35:35.623 31296-31296/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
07-12 13:35:35.695 31296-31321/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
07-12 13:35:35.725 31296-31321/? I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
07-12 13:35:35.726 31296-31321/? I/OpenGLRenderer: Initialized EGL, version 1.4
07-12 13:35:39.223 31296-31371/com.yenks.glidenewtimeout D/skia: --- SkImageDecoder::Factory returned null
07-12 13:35:39.223 31296-31371/com.yenks.glidenewtimeout D/skia: --- SkImageDecoder::Factory returned null
07-12 13:35:39.223 31296-31371/com.yenks.glidenewtimeout D/skia: --- SkImageDecoder::Factory returned null
07-12 13:35:39.223 31296-31371/com.yenks.glidenewtimeout D/skia: --- SkImageDecoder::Factory returned null
07-12 13:35:39.226 31296-31371/com.yenks.glidenewtimeout D/skia: --- SkImageDecoder::Factory returned null
07-12 13:35:39.226 31296-31371/com.yenks.glidenewtimeout D/skia: --- SkImageDecoder::Factory returned null
07-12 13:35:39.226 31296-31371/com.yenks.glidenewtimeout D/skia: --- SkImageDecoder::Factory returned null
07-12 13:35:39.226 31296-31371/com.yenks.glidenewtimeout D/skia: --- SkImageDecoder::Factory returned null
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/Glide: Load failed for https://od.lk/s/121195309_xa4Rd/Cover.jpg with size [1080x1536]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Object->Drawable}, REMOTE, https://od.lk/s/121195309_xa4Rd/Cover.jpg
Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->Drawable}
Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Bitmap->Drawable}
Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->BitmapDrawable->Drawable}
Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Object->Drawable}, REMOTE, https://od.lk/s/121195309_xa4Rd/Cover.jpg
Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->Drawable}
Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->Bitmap->Drawable}
Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->BitmapDrawable->Drawable}
Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor->Object->Drawable}, REMOTE, https://od.lk/s/121195309_xa4Rd/Cover.jpg
Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->Bitmap->Drawable}
Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->BitmapDrawable->Drawable}
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout E/Glide: class com.bumptech.glide.load.engine.GlideException: Failed to load resource
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout D/glideexeception: Failed to load resource
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: class com.bumptech.glide.load.engine.GlideException: Failed to load resource
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Object->Drawable}, REMOTE, https://od.lk/s/121195309_xa4Rd/Cover.jpg
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->Drawable}
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Bitmap->Drawable}
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->BitmapDrawable->Drawable}
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Object->Drawable}, REMOTE, https://od.lk/s/121195309_xa4Rd/Cover.jpg
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->Drawable}
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->Bitmap->Drawable}
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->BitmapDrawable->Drawable}
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor->Object->Drawable}, REMOTE, https://od.lk/s/121195309_xa4Rd/Cover.jpg
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->Bitmap->Drawable}
07-12 13:35:39.273 31296-31296/com.yenks.glidenewtimeout W/System.err: Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->BitmapDrawable->Drawable}
I was just working on integrating this library into my in-development app for a website, and it appears I'm having the same issues as well, using 4.0.0 RC1.
Link to image: https://www.pokecommunity.com/customavatars/avatar150187_74.gif
logcat:
07-13 22:55:57.145 13231-13231/com.jvk.android.pcnotifier W/Glide: Load failed for https://www.pokecommunity.com/customavatars/avatar150187_74.gif with size [551x248]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
Cause (1 of 4): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->GifDrawable->GifDrawable}, DATA_DISK_CACHE, https://www.pokecommunity.com/customavatars/avatar150187_74.gif
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->GifDrawable}
Cause (2 of 4): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->GifDrawable->GifDrawable}, DATA_DISK_CACHE, https://www.pokecommunity.com/customavatars/avatar150187_74.gif
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->GifDrawable}
Cause (3 of 4): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->GifDrawable->GifDrawable}, REMOTE, https://www.pokecommunity.com/customavatars/avatar150187_74.gif
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->GifDrawable}
Cause (4 of 4): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->GifDrawable->GifDrawable}, REMOTE, https://www.pokecommunity.com/customavatars/avatar150187_74.gif
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->GifDrawable}
07-13 22:55:57.145 13231-13231/com.jvk.android.pcnotifier E/Glide: class com.bumptech.glide.load.engine.GlideException: Failed to load resource
Code being used to load the image:
ImageView iv = (ImageView) headerLayout.findViewById(R.id.imageViewAvatar);
RequestOptions ro = new RequestOptions()
.fitCenter()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(R.drawable.icon_color3)
.override(256, 140)
.fitCenter();
if (!sharedPrefs.getString("myAvatarURL", "").equals("")) {
//we have an avatar revision, use a url stringbuilder to get the avatar, download it, and set it to the drawer icon.
String imageURL = sharedPrefs.getString("myAvatarURL", "");
Glide.with(getApplicationContext()).asGif().load(imageURL).apply(ro).into(iv);
}
else
{
Glide.with(getApplicationContext()).load(R.drawable.icon_color3).apply(ro).into(iv); //default load the PC icon as the user's avatar.
}
For https://od.lk/s/119127432_OQkeb/tumblr_of4zhq2tW71r2qr2so1_500.jpg this occurs because we're passing in an Accept-Encoding header of 'identity' and getting back an encoding of 'deflate'.
I think that's a bug in the backend serving that url. It's probably something we can handle locally as well. The Android documentation for HttpUrlConnection seems incorrect in that if we don't pass in that header (on API 25 at least), we still get back valid content lengths: https://developer.android.com/reference/java/net/HttpURLConnection.html.
I hate replying to a closed issue, but I tried the 20170714 snapshot to see if this issue would be rectified, however, I'm still getting the same errors. In addition, using Picasso's into function, the same image URL works perfectly fine in the ImageView.
@Incineroar Can you open a new issue with whatever urls and errors you're seeing?
@sjudd ,@Incineroar , @azurh
I faced similar issue , but was resolved when i removed asGif().
@geniushkg yes ,"but was resolved when i removed asGif()." i find this.
why ?