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

[BUG] image not loading (using glide plugin) #217

Open
1 task done
adbenitez opened this issue Apr 23, 2024 · 1 comment
Open
1 task done

[BUG] image not loading (using glide plugin) #217

adbenitez opened this issue Apr 23, 2024 · 1 comment

Comments

@adbenitez
Copy link

adbenitez commented Apr 23, 2024

New Issue Checklist

  • I have searched for a similar issue in the project and found none

Issue Info

Info Value
Device Info android emulator (Pixel API 16)
System Version 4.1
APNG4Android Library Version glide-plugin:3.0.1 (and glide 4.16.0)
Repro rate all the time (100%)
Repro with our demo project where can I find it?
Demo project link

Issue Description and Steps

it is happening to me again with some particular png images that this library fail to load, if I remove the library from the dependencies, then the image load correctly, the output I see is:

2024-04-23 22:10:01.183 15540-15606 APNGDecoder             com.b44t.messenger.beta              E  chunk read reach to end
2024-04-23 22:11:00.723 15540-15540 FrameSeqDecoder         com.b44t.messenger.beta              E   Processing,wait for finish at FINISHING
2024-04-23 22:11:00.723 15540-15606 APNGDecoder             com.b44t.messenger.beta              E  chunk read reach to end

I tried to isolate the with a simple activity:

TestActivity.java:

package org.thoughtcrime.securesms;

import android.os.Bundle;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.github.penfeizhou.animation.glide.AnimationDecoderOption;

import org.thoughtcrime.securesms.mms.GlideApp;

public class TestActivity extends AppCompatActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.test_layout);
      ImageView image = findViewById(R.id.image);
      GlideApp.with(this)
          .load("file:///data/data/com.b44t.messenger.beta/files/accounts/508a7214-c64f-438e-ac1b-a24e35da7216/dc.db-blobs/image_2024-04-23_18-21-25.png")
          .diskCacheStrategy(DiskCacheStrategy.NONE)
        //.set(AnimationDecoderOption.DISABLE_ANIMATION_APNG_DECODER, true)
          .into(image);
  }
}

test_layout.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_height="match_parent" android:layout_width="match_parent">

    <ImageView
        android:id="@+id/image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
</RelativeLayout>

this is the image:
image_2024-04-23_09-40-30

I also tried setting .set(AnimationDecoderOption.DISABLE_ANIMATION_APNG_DECODER, true) but it still didn't work, how can I completely disable the APNG decoder? I am mainly interested in animated webp, the apng decoder is causing too much issues with normal png in my project too often, if it is not an apng it should just skip and do nothing instead of failing so badly, since without it glide will show the png normally even if it is an APNG it still would fallback to static PNG that is better than a blank page

@adbenitez
Copy link
Author

the same happens with this image:

2024-04-23 23:09:46.823 17130-17130 FrameSeqDecoder         com.b44t.messenger.beta              E   Processing,wait for finish at FINISHING
2024-04-23 23:09:46.823 17130-17195 APNGDecoder             com.b44t.messenger.beta              E  chunk read reach to end

304147030-8166bc73-8d87-43d6-855a-cf945beaf462

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