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

@ -26,7 +26,8 @@ The format is simplified version of [Keep a Changelog](https://keepachangelog.co
- Fix certain Infinix devices being unable to use any "Open link in browser" actions, including tracker setup (@MajorTanya)
- Fix source filter bottom sheet unable to be fully scrolled to the bottom
- Prevent potential "Comparison method violates its general contract!" crash
- Fix staggered grid cover being squashed for local source
### Translation
- Update translations from Weblate

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) {