Fix issue where gifs would load as images.

This commit is contained in:
Alex Hart
2021-05-06 16:19:24 -03:00
committed by GitHub
parent bcbd365326
commit cb9ab61b6b
9 changed files with 101 additions and 113 deletions

View File

@@ -29,7 +29,7 @@ import org.thoughtcrime.securesms.blurhash.BlurHashResourceDecoder;
import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto;
import org.thoughtcrime.securesms.crypto.AttachmentSecret;
import org.thoughtcrime.securesms.crypto.AttachmentSecretProvider;
import org.thoughtcrime.securesms.emoji.EmojiBitmapDecoder;
import org.thoughtcrime.securesms.emoji.EmojiPage;
import org.thoughtcrime.securesms.giph.model.ChunkedImageUrl;
import org.thoughtcrime.securesms.glide.ChunkedImageUrlLoader;
import org.thoughtcrime.securesms.glide.ContactPhotoLoader;
@@ -83,7 +83,6 @@ public class SignalGlideModule extends AppGlideModule {
ApngBufferCacheDecoder apngBufferCacheDecoder = new ApngBufferCacheDecoder();
ApngStreamCacheDecoder apngStreamCacheDecoder = new ApngStreamCacheDecoder(apngBufferCacheDecoder);
registry.prepend(InputStream.class, Bitmap.class, new EmojiBitmapDecoder(glide.getBitmapPool()));
registry.prepend(InputStream.class, APNGDecoder.class, apngStreamCacheDecoder);
registry.prepend(ByteBuffer.class, APNGDecoder.class, apngBufferCacheDecoder);
registry.prepend(APNGDecoder.class, new EncryptedApngCacheEncoder(secret));
@@ -92,6 +91,7 @@ public class SignalGlideModule extends AppGlideModule {
registry.prepend(BlurHash.class, Bitmap.class, new BlurHashResourceDecoder());
registry.append(EmojiPage.class, Bitmap.class, new EmojiPage.Loader.Factory(context));
registry.append(ConversationShortcutPhoto.class, Bitmap.class, new ConversationShortcutPhoto.Loader.Factory(context));
registry.append(ContactPhoto.class, InputStream.class, new ContactPhotoLoader.Factory(context));
registry.append(DecryptableUri.class, InputStream.class, new DecryptableStreamUriLoader.Factory(context));