Skip to content

Commit 348a79f

Browse files
Fix thumbnail not being displayed in media notification
1 parent c4ada7f commit 348a79f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

app/src/main/java/org/schabi/newpipe/util/image/CoilHelper.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,13 @@ object CoilHelper {
6767
var newHeight = input.height / (input.width / notificationThumbnailWidth)
6868
val result = input.scale(notificationThumbnailWidth, newHeight)
6969

70-
if (result == input || !result.isMutable) {
70+
return if (result == input || !result.isMutable) {
7171
// create a new mutable bitmap to prevent strange crashes on some
7272
// devices (see #4638)
7373
newHeight = input.height / (input.width / (notificationThumbnailWidth - 1))
74-
val copied = input.scale(notificationThumbnailWidth, newHeight)
75-
input.recycle()
76-
return copied
74+
input.scale(notificationThumbnailWidth, newHeight)
7775
} else {
78-
input.recycle()
79-
return result
76+
result
8077
}
8178
}
8279
})

0 commit comments

Comments
 (0)