Commit graph

11 commits

Author SHA1 Message Date
Mehakdeep Singh
861ee65113 perf(library): decode covers at thumbnail resolution to cut image-cache RAM
Refs #609 (high RAM with stutters).

Manga / anime covers from sources are typically 720x1080 or larger
(~3 MB decoded RGBA per cover). The library grid, library list and
generic browse / search card widgets render those covers at roughly
150x220 logical pixels, but every cover decoded to its full source
resolution and that decoded bitmap landed in Flutter's `imageCache`.
With 30-50 covers in flight during a normal scroll, the default
100 MB cache filled and the engine started evicting + re-decoding
aggressively — exactly the symptom in #609 (stutters + high RAM).

Mangayomi already had `ExtendedResizeImage` available via the
`extended_image_library` package and used it in one place
(`cachedCompressedNetworkImage`, called only from the History
screen). This commit generalises that pattern.

Add a `coverProvider()` helper in `lib/utils/cached_network.dart`
that wraps `CustomExtendedNetworkImageProvider` in
`ExtendedResizeImage` with a 200 KB encoded budget — sharp at
typical thumbnail size on high-DPR screens, ~3.6x smaller decoded
than a full-resolution cover. Pass through the same `cache` /
`cacheMaxAge` knobs the underlying provider exposes so existing
disk-cache behaviour is preserved.

Swap the three high-traffic thumbnail call sites to use it:

* `lib/modules/library/widgets/library_gridview_widget.dart`
* `lib/modules/library/widgets/library_listview_widget.dart`
* `lib/modules/widgets/manga_image_card_widget.dart`
  (both `MangaImageCardWidget` and `MangaImageCardListTileWidget`,
  used by browse and search results)

Deliberately not changed:

* The manga / anime detail page hero cover — large display, full
  resolution is appropriate.
* Reader pages — already memory-managed by `ChapterPreloadManager`
  and need full resolution for actual reading.
* `cachedNetworkImage()` and other lower-traffic thumbnail surfaces
  (tracker results, calendar, recommendation grid). Easy to extend
  in a follow-up if anyone asks; kept narrow here so review is
  manageable.

Verified

* `flutter analyze` clean on every touched file
* `flutter build macos --release` succeeds
* Smoke-tested on macOS with the local-all-fixes build: library
  grid, library list and browse card all render identical-looking
  covers at typical thumbnail sizes; no visible quality regression
  at the displayed scale
2026-05-09 23:37:44 -07:00
NBA2K1
49f77febe4 Don't allow zooming
When these methods were used to display images (migration screen, history screen, etc) the images (anime/manga covers and extension icons) were zoomable. You could (on a touch device) pinch to zoom.
And with the mouse you could get your cursor an on image and scroll up to zoom out and scroll down to zoom in.
This was not necessary confusing for the user.
2025-06-29 20:30:16 +02:00
Moustapha Kodjo Amadou
80efee40d1 dart format 2025-05-30 17:43:42 +01:00
Schnitzel5
50fe6abfac updates screen search query 2025-04-14 00:00:41 +02:00
Schnitzel5
454445ad25 fixed auto theme 2025-04-08 23:39:17 +02:00
Moustapha Kodjo Amadou
3e401c8af2 dart format 2025-02-23 15:31:49 +01:00
kodjomoustapha
6deffa4b97 refactor CodeEditor & update package 2025-01-08 12:51:16 +01:00
kodjomoustapha
6ed57e2e44 rm 2024-05-27 09:26:30 +01:00
kodjomoustapha
d168b6ddcd Added cronet_http & cupertino_http, remove unnecessary packages 2024-03-14 17:40:15 +01:00
kodjodevf
0d7fbf3ca6 mangagere http header fix & add comick scanlator 2023-05-02 12:12:43 +01:00
kodjodevf
c90b78831f add popular manga service , widget , manga home 2023-04-03 17:13:05 +01:00