Skip to content

Commit

Permalink
Fix thumbnail not being displayed in media notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Jul 3, 2024
1 parent c4ada7f commit 348a79f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/src/main/java/org/schabi/newpipe/util/image/CoilHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
})
Expand Down

0 comments on commit 348a79f

Please sign in to comment.