From 51c1f95791504e1d4a21560a3774e3cf7abde8a9 Mon Sep 17 00:00:00 2001 From: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com> Date: Tue, 9 Dec 2025 16:16:05 +0700 Subject: [PATCH] fix(manga-cover-dialog): Avoid crash with SubsamplingScaleImageView (SSIV) not fully support Hardware decoder (#1319) * Avoid crash with SubsamplingScaleImageView (SSIV) not fully support Hardware decoder * keep original config if it's not Hardware * refactor --- .../presentation/manga/components/MangaCoverDialog.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaCoverDialog.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaCoverDialog.kt index c2daa01d5..fab7fd505 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaCoverDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaCoverDialog.kt @@ -212,7 +212,11 @@ fun MangaCoverDialog( // Copy bitmap in case it came from memory cache // Because SSIV needs to thoroughly read the image - val copy = (drawable as? BitmapDrawable)?.bitmap?.copy(Bitmap.Config.HARDWARE, false) + // KMK --> + val src = (drawable as? BitmapDrawable)?.bitmap + val config = src?.config?.takeIf { it != Bitmap.Config.HARDWARE } ?: Bitmap.Config.ARGB_8888 + // KMK <-- + val copy = src?.copy(config, false) ?.toDrawable(view.context.resources) ?: drawable view.setImage(copy, ReaderPageImageView.Config(zoomDuration = 500))