fix: staggered grid cover being squashed for local source (#398)

* fix: cover ratio NaN for local source

* unused

* Update CHANGELOG.md
This commit is contained in:
AwkwardPeak7 2025-05-11 17:52:43 +05:00 committed by GitHub
parent f035454150
commit 2b2e0491e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -66,7 +66,12 @@ object MangaCoverMetadata {
} else {
options.inSampleSize = 4
}
val bitmap = BitmapFactory.decodeFile(file.filePath, options)
val bitmap = try {
val stream = file.openInputStream()
BitmapFactory.decodeStream(stream, null, options)
} catch (_: Throwable) {
null
}
if (bitmap != null) {
Palette.from(bitmap).generate { palette ->
if (isInLibrary) {