From b80abf5cc802ab5b3af13c2becbc2347a612a2ba Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 27 Oct 2026 14:02:03 -0700 Subject: [PATCH] =?UTF-8?q?Create=20ArticleThumbnailFinder.fullSizeImageDa?= =?UTF-8?q?ta=20so=20article=20view=20can=20share=20timeline=E2=80=99s=20c?= =?UTF-8?q?opy=20of=20an=20image.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Modules/Images/Sources/Images/ArticleThumbnailFinder.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/Images/Sources/Images/ArticleThumbnailFinder.swift b/Modules/Images/Sources/Images/ArticleThumbnailFinder.swift index 46d6c9765..c1b0d6faa 100644 --- a/Modules/Images/Sources/Images/ArticleThumbnailFinder.swift +++ b/Modules/Images/Sources/Images/ArticleThumbnailFinder.swift @@ -105,6 +105,13 @@ extension Notification.Name { findImage(url, mode: mode, downloadPriority: .prefetch, activityDetail: articleTitle) } + /// The image as downloaded, for the article view, which shows the thumbnail image at full size. + /// Shares the timeline’s copy and any download in progress, so the image is downloaded once. + /// A download starts right away rather than waiting behind timeline downloads. + public func fullSizeImageData(url: String, articleTitle: String?) async throws(ImageDownloadError) -> Data { + try await DownloadedImageCache.shared.imageData(for: url, downloadPriority: nil, checksForUpdates: false, activityOwner: .thumbnailDownloader, activityKind: .downloadThumbnail(imageURL: url), activityDetail: articleTitle) + } + /// Nil when the article has no usable image, or when its HTML hasn’t been checked yet. public func thumbnailURL(for article: Article, mode: Mode) -> String? { if let providedThumbnailURL = providedThumbnailURL(for: article, mode: mode) {