From f28d6041b931f1ecc94be95d2b3fd9f82e4f393f Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Thu, 29 Oct 2026 11:02:32 -0700 Subject: [PATCH] Save memory by decoding small thumbnails at 256 instead of 512, which is big enough for the 76pt size at 3x. --- Modules/Images/Sources/Images/ArticleThumbnailFinder.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Images/Sources/Images/ArticleThumbnailFinder.swift b/Modules/Images/Sources/Images/ArticleThumbnailFinder.swift index da360dc1f..a3ee57c4b 100644 --- a/Modules/Images/Sources/Images/ArticleThumbnailFinder.swift +++ b/Modules/Images/Sources/Images/ArticleThumbnailFinder.swift @@ -66,10 +66,10 @@ extension Notification.Name { private var cacheKeysInProgress = Set() private var urlsThatFailedToDecode = Set() // So a failure notification can’t lead to the same attempt again - /// Decoded bitmaps: about 1 MB each in small mode, 2–5 MB in large mode. + /// Decoded bitmaps: about 0.25 MB each in small mode, 2–5 MB in large mode. private static let imageCacheByteLimit = 128 * 1024 * 1024 - /// Sized for aspect-fill cropping into a small square. - private static let smallThumbnailMaxPixelSize = 512 + /// The small thumbnail is aspect-fit into a box of at most 76pt, which is 228 pixels at 3x. + private static let smallThumbnailMaxPixelSize = 256 /// Sized to fill the timeline’s width. private static let largeThumbnailMaxPixelSize = 1200 /// HTML images saved per article, so one that fails or is too small falls through to the next.