From 348a79f91dbe9c442d64bc2914258aa955c9d868 Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Wed, 3 Jul 2024 14:41:32 +0530 Subject: [PATCH] Fix thumbnail not being displayed in media notification --- .../java/org/schabi/newpipe/util/image/CoilHelper.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/image/CoilHelper.kt b/app/src/main/java/org/schabi/newpipe/util/image/CoilHelper.kt index 1f49a4a4f..ab7cd79a8 100644 --- a/app/src/main/java/org/schabi/newpipe/util/image/CoilHelper.kt +++ b/app/src/main/java/org/schabi/newpipe/util/image/CoilHelper.kt @@ -67,16 +67,13 @@ object CoilHelper { var newHeight = input.height / (input.width / notificationThumbnailWidth) val result = input.scale(notificationThumbnailWidth, newHeight) - if (result == input || !result.isMutable) { + return if (result == input || !result.isMutable) { // create a new mutable bitmap to prevent strange crashes on some // devices (see #4638) newHeight = input.height / (input.width / (notificationThumbnailWidth - 1)) - val copied = input.scale(notificationThumbnailWidth, newHeight) - input.recycle() - return copied + input.scale(notificationThumbnailWidth, newHeight) } else { - input.recycle() - return result + result } } })