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

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

Open
marchlqq opened this issue Oct 8, 2024 · 7 comments

Comments

@marchlqq
Copy link

marchlqq commented Oct 8, 2024

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(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
Copy link
Author

marchlqq commented Oct 8, 2024

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
Copy link
Author

Is there no one handling the issue with Glide now?

@marchlqq
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@marchlqq
Copy link
Author

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")

@NGC185air110
Copy link

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

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

No branches or pull requests

2 participants