From cbbd2c3f4b0383d83bc6b16a0ec9dd3b29f1e69f Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 17 Aug 2025 21:49:38 -0700 Subject: [PATCH 1/2] Fix rendering bug with some favicons. Use proper scaling factor and avoid converting to TIFF. --- Modules/RSCore/Sources/RSCore/Shared/RSScreen.swift | 5 ++++- Shared/Favicons/FaviconDownloader.swift | 11 +++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Modules/RSCore/Sources/RSCore/Shared/RSScreen.swift b/Modules/RSCore/Sources/RSCore/Shared/RSScreen.swift index 4fee278db..2c10769bc 100644 --- a/Modules/RSCore/Sources/RSCore/Shared/RSScreen.swift +++ b/Modules/RSCore/Sources/RSCore/Shared/RSScreen.swift @@ -10,7 +10,10 @@ import AppKit public class RSScreen { - public static var maxScreenScale = CGFloat(2) + + public static var maxScreenScale: CGFloat { + NSScreen.screens.map(\.backingScaleFactor).max() ?? 2.0 + } } #endif diff --git a/Shared/Favicons/FaviconDownloader.swift b/Shared/Favicons/FaviconDownloader.swift index e4d5495d1..4f8577835 100644 --- a/Shared/Favicons/FaviconDownloader.swift +++ b/Shared/Favicons/FaviconDownloader.swift @@ -102,12 +102,11 @@ final class FaviconDownloader { return image } - if let iconImage = favicon(for: webFeed), let imageData = iconImage.image.dataRepresentation() { - if let scaledImage = RSImage.scaledForIcon(imageData) { - let scaledIconImage = IconImage(scaledImage) - cache[webFeed] = scaledIconImage - return scaledIconImage - } + if let iconImage = favicon(for: webFeed) { + // Skip the data conversion roundtrip that can introduce artifacts + // Use the original image directly for better quality + cache[webFeed] = iconImage + return iconImage } return nil From d52a1e279c960a1b165f7ad90115b5c248fc98d9 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 9 Sep 2025 20:49:02 -0700 Subject: [PATCH 2/2] Fix formatting and remove unneeded comment. --- Shared/Favicons/FaviconDownloader.swift | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Shared/Favicons/FaviconDownloader.swift b/Shared/Favicons/FaviconDownloader.swift index 4f8577835..40bf245d1 100644 --- a/Shared/Favicons/FaviconDownloader.swift +++ b/Shared/Favicons/FaviconDownloader.swift @@ -97,18 +97,16 @@ final class FaviconDownloader { } func faviconAsIcon(for webFeed: WebFeed) -> IconImage? { - + if let image = cache[webFeed] { return image } - + if let iconImage = favicon(for: webFeed) { - // Skip the data conversion roundtrip that can introduce artifacts - // Use the original image directly for better quality cache[webFeed] = iconImage return iconImage } - + return nil }