From 82a657b82e61dd06aff9c5bbe2ef23b6f797d359 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 19 Jul 2023 07:53:43 +0800 Subject: [PATCH 1/2] Set aspect ratio to fit on feature card images --- .../OmnivoreKit/Sources/Views/FeedItem/LibraryFeatureCard.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryFeatureCard.swift b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryFeatureCard.swift index 1843c2646..4c908221b 100644 --- a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryFeatureCard.swift +++ b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryFeatureCard.swift @@ -40,8 +40,8 @@ public struct LibraryFeatureCard: View { EmptyView() case let .success(image): image.resizable() + .aspectRatio(contentMode: .fit) .frame(width: 146, height: 90) - .aspectRatio(contentMode: .fill) case .failure: fallbackImage From 4f40afa5b7bbd741982381717131019701792a76 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 19 Jul 2023 11:16:21 +0800 Subject: [PATCH 2/2] Improve scaling of thumbnails, better placeholder while loading --- apple/Omnivore.xcodeproj/project.pbxproj | 8 ++++---- .../Sources/Views/FeedItem/LibraryFeatureCard.swift | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apple/Omnivore.xcodeproj/project.pbxproj b/apple/Omnivore.xcodeproj/project.pbxproj index 25d13c1f2..540bae3c6 100644 --- a/apple/Omnivore.xcodeproj/project.pbxproj +++ b/apple/Omnivore.xcodeproj/project.pbxproj @@ -1400,7 +1400,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.0; - MARKETING_VERSION = 1.27.0; + MARKETING_VERSION = 1.28.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; @@ -1435,7 +1435,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.0; - MARKETING_VERSION = 1.27.0; + MARKETING_VERSION = 1.28.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1490,7 +1490,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.27.0; + MARKETING_VERSION = 1.28.0; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = Omnivore; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1831,7 +1831,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.27.0; + MARKETING_VERSION = 1.28.0; PRODUCT_BUNDLE_IDENTIFIER = app.omnivore.app; PRODUCT_NAME = Omnivore; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryFeatureCard.swift b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryFeatureCard.swift index 4c908221b..9df2f06a8 100644 --- a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryFeatureCard.swift +++ b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryFeatureCard.swift @@ -37,11 +37,14 @@ public struct LibraryFeatureCard: View { AsyncImage(url: imageURL) { phase in switch phase { case .empty: - EmptyView() + Color.systemBackground + .frame(width: 146, height: 90) case let .success(image): image.resizable() - .aspectRatio(contentMode: .fit) + .resizable() + .scaledToFill() .frame(width: 146, height: 90) + .clipped() case .failure: fallbackImage @@ -50,7 +53,8 @@ public struct LibraryFeatureCard: View { // we need to add this currently unused fallback // to handle any new cases that might be added // in the future: - EmptyView() + Color.systemBackground + .frame(width: 146, height: 90) } } } else {