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

Big PNG can't be decoded: Mark has been invalidated #5383

Open
mice777 opened this issue Mar 19, 2024 · 0 comments
Open

Big PNG can't be decoded: Mark has been invalidated #5383

mice777 opened this issue Mar 19, 2024 · 0 comments

Comments

@mice777
Copy link

mice777 commented Mar 19, 2024

Glide Version:
4.16.0
(same with 5.0.0-rc01)

Integration libraries:
No

Device/Android Version:
Android 12

Issue details / Repro steps / Use case background:
Attached big image can't be loaded.
It seems that hardcoded 5MB mark limit was reached
in RecyclableBufferedInputStream, and loader can't recover from this with large image.

Attached image:
noise

Glide load line / GlideModule (if any) / list Adapter code (if any):

Glide.with(itemView.context)
                    .load(file)
                    .into(preview)

Layout XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="@dimen/item_review_width"
    android:layout_height="@dimen/item_review_height"
    android:background="@drawable/selector_video_background">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/item_review_img_height"
        android:layout_margin="@dimen/padding_mini">

        <ImageView
            android:id="@+id/preview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="fitCenter" />
...

Stack trace / LogCat:

11:34:06.423 System.err               W  com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream$InvalidMarkException: Mark has been invalidated, pos: 3895959 markLimit: 5242880
11:34:06.426                          W  	at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.reset(RecyclableBufferedInputStream.java:344)
11:34:06.429                          W  	at com.bumptech.glide.load.ImageHeaderParserUtils$5.getOrientationAndRewind(ImageHeaderParserUtils.java:184)
11:34:06.432                          W  	at com.bumptech.glide.load.ImageHeaderParserUtils.getOrientationInternal(ImageHeaderParserUtils.java:229)
11:34:06.435                          W  	at com.bumptech.glide.load.ImageHeaderParserUtils.getOrientation(ImageHeaderParserUtils.java:176)
11:34:06.437                          W  	at com.bumptech.glide.load.resource.bitmap.ImageReader$InputStreamImageReader.getImageOrientation(ImageReader.java:204)
11:34:06.438                          W  	at com.bumptech.glide.load.resource.bitmap.Downsampler.decodeFromWrappedStreams(Downsampler.java:330)
11:34:06.439                          W  	at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:285)
11:34:06.440                          W  	at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:222)
11:34:06.441                          W  	at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:62)
11:34:06.442                          W  	at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:18)
11:34:06.443                          W  	at com.bumptech.glide.load.resource.bitmap.BitmapDrawableDecoder.decode(BitmapDrawableDecoder.java:58)
11:34:06.444                          W  	at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:92)
11:34:06.445                          W  	at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:70)
11:34:06.445                          W  	at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:59)
11:34:06.446                          W  	at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:76)
11:34:06.447                          W  	at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:57)
11:34:06.447                          W  	at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:539)
11:34:06.448                          W  	at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:503)
11:34:06.449                          W  	at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:489)
11:34:06.450                          W  	at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:434)
11:34:06.451                          W  	at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:399)
11:34:06.451                          W  	at com.bumptech.glide.load.engine.SourceGenerator.onDataReadyInternal(SourceGenerator.java:211)
11:34:06.452                          W  	at com.bumptech.glide.load.engine.SourceGenerator$1.onDataReady(SourceGenerator.java:101)
11:34:06.453                          W  	at com.bumptech.glide.StorageFileModelLoader$Fetcher.loadData(GlideModule.kt:151)
11:34:06.454                          W  	at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:95)
11:34:06.454                          W  	at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:88)
11:34:06.455                          W  	at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
11:34:06.455                          W  	at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
11:34:06.456                          W  	at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
11:34:06.457                          W  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
11:34:06.457                          W  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
11:34:06.458                          W  	at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:424)
11:34:06.458                          W  	at java.lang.Thread.run(Thread.java:920)
11:34:06.459                          W  	at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultPriorityThreadFactory$1.run(GlideExecutor.java:383)
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

1 participant