glide icon indicating copy to clipboard operation
glide copied to clipboard

Glide encountered an abnormal loading of a certain URL, while there are currently no issues with other URLs.

Open marchlqq opened this issue 1 year ago • 7 comments
trafficstars

Loading images through Glide, this way of loading, linking https://i-blog.csdnimg.cn/direct/efed520f694b4f31aa30e236c7bfa0ed.jpeg Cannot load normally.

Specific code: // Glide.with(this) // .load(url) // .into(imageView); or // Glide.with(this) // .asBitmap() // .load(url) // .apply(requestOptions) // .into(new ImageViewTarget<Bitmap>(imageView) { // @Override // protected void setResource(@Nullable Bitmap resource) { // imageView.setImageBitmap(resource); // } // });

By querying the Android folder and glide cache, it can be confirmed that the image download is successful and can be previewed on the PC end. Moreover, images can also be loaded normally through BitmapFactory. decodeFile (filePath, options). Verified by the Picasso framework, it can be loaded normally. So, it can be concluded that the Glide framework encountered problems when parsing into a bitmap. Can you help to query and fix it?

marchlqq avatar Oct 08 '24 03:10 marchlqq

Partial exception log: Load failed for [https://i-blog.csdnimg.cn/direct/efed520f694b4f31aa30e236c7bfa0ed.jpeg] with dimensions [1440x400] class com.bumptech.glide.load.engine.GlideException: Failed to load resource There were 24 root causes: java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSource failed: status = 0x80000000) java.lang.RuntimeException(setDataSource failed: status = 0x80000000) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSource failed: status = 0x80000000) java.lang.RuntimeException(setDataSource failed: status = 0x80000000) call GlideException#logRootCauses(String) for more detail Cause (1 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->Object->Drawable}, DATA_DISK_CACHE, https://i-blog.csdnimg.cn/direct/efed520f694b4f31aa30e236c7bfa0ed.jpeg There were 6 root causes: java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) call GlideException#logRootCauses(String) for more detail Cause (1 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Drawable->Drawable} There were 2 root causes: java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2)) java.lang.RuntimeException(setDataSourceCallback failed: status = 0x80000000) call GlideException#logRootCauses(String) for more detail Cause (1 of 2): class java.lang.IndexOutOfBoundsException: index=-2023161846 out of bounds (limit=86, nb=2) Cause (2 of 2): class java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000 Cause (2 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->Drawable} Cause (3 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->Bitmap->BitmapDrawable} There were 2 root causes: java.lang.IndexOutOfBoundsException(index=-2023161846 out of bounds (limit=86, nb=2))

marchlqq avatar Oct 08 '24 08:10 marchlqq

Is there no one handling the issue with Glide now?

marchlqq avatar Oct 10 '24 06:10 marchlqq

class:DefaultImageHeaderParser int tagCount = segmentData.getInt16(firstIfdOffset);

private static final class RandomAccessReader {

short getInt16(int offset) {
  return isAvailable(offset, 2) ? data.getShort(offset) : -1;
}

the code: data.getShort(offset) has exception:Method threw 'java.lang.IndexOutOfBoundsException' exception.

marchlqq avatar Oct 10 '24 08:10 marchlqq

private int getOrientation(Reader reader, ArrayPool byteArrayPool) throws IOException { try { final int magicNumber = reader.getUInt16(); // .... } catch (Reader.EndOfFileException e) { // TODO(b/143917798): Re-enable this logging when dependent tests are fixed. // if (Log.isLoggable(TAG, Log.ERROR)) { // Log.e(TAG, "Unexpected EOF", e); // } return UNKNOWN_ORIENTATION; } }

modify Reader.EndOfFileException to Exception } catch (Exception e) {

can finish this issue

marchlqq avatar Oct 10 '24 09:10 marchlqq

Can solve this problem. But packing aar is more troublesome. I have packed 3 aars here, namely libray, gif_decoder, and disklrucache.

marchlqq avatar Oct 10 '24 09:10 marchlqq

implementation(name: 'glide-4.16.0-release', ext: 'aar')
implementation ("com.github.bumptech.glide:gifdecoder:4.16.0")
implementation ("com.github.bumptech.glide:disklrucache:4.16.0")
implementation ("com.github.bumptech.glide:annotations:4.16.0")

marchlqq avatar Oct 11 '24 06:10 marchlqq

This is a recurring issue; I occasionally encounter certain phones that function properly while others do not. The status code is 0x80000000.

NGC185air110 avatar Oct 17 '24 02:10 NGC185air110