From 610af7a29ed84ea333e0cc4776ea3026f28855f6 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 22 Apr 2026 11:37:30 +0300 Subject: [PATCH] force jpeg format for avatar download in NSE CDN may serve WebP by default which INImage doesn't reliably handle. Append @jpeg to the URL to request JPEG format instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- modules/BlueskyNSE/NotificationService.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/BlueskyNSE/NotificationService.swift b/modules/BlueskyNSE/NotificationService.swift index eaf85924df..96ca79a391 100644 --- a/modules/BlueskyNSE/NotificationService.swift +++ b/modules/BlueskyNSE/NotificationService.swift @@ -118,11 +118,19 @@ class NotificationService: UNNotificationServiceExtension { } func downloadAvatarImage(from urlString: String) -> INImage? { - let thumbnailUrlString = urlString.replacingOccurrences( + var thumbnailUrlString = urlString.replacingOccurrences( of: "/img/avatar/", with: "/img/avatar_thumbnail/" ) + // CDN URLs may end with @webp or no extension (which defaults to webp). + // INImage doesn't reliably handle WebP, so force JPEG. + if let atRange = thumbnailUrlString.range(of: "@", options: .backwards) { + thumbnailUrlString = String(thumbnailUrlString[..