Skip to content

Commit 9c6349c

Browse files
committed
Update demo to add AVIF test images and AVIF animated images
1 parent 79961a5 commit 9c6349c

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

Example/SDWebImageSwiftUI.xcodeproj/xcshareddata/xcschemes/SDWebImageSwiftUIDemo-watchOS WatchKit App.xcscheme

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
ignoresPersistentStateOnLaunch = "NO"
5454
debugDocumentVersioning = "YES"
5555
debugServiceExtension = "internal"
56-
allowLocationSimulation = "YES"
57-
notificationPayloadFile = "PushNotificationPayload.apns">
56+
allowLocationSimulation = "YES">
5857
<BuildableProductRunnable
5958
runnableDebuggingMode = "0">
6059
<BuildableReference

Example/SDWebImageSwiftUIDemo/AppDelegate.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import UIKit
1010
import SDWebImage
1111
import SDWebImageWebPCoder
12+
import SDWebImageAVIFCoder
1213
import SDWebImageSVGCoder
1314
import SDWebImagePDFCoder
1415

@@ -21,6 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2122
// Override point for customization after application launch.
2223
// Add WebP/SVG/PDF support
2324
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
25+
SDImageCodersManager.shared.addCoder(SDImageAVIFCoder.shared)
2426
SDImageCodersManager.shared.addCoder(SDImageSVGCoder.shared)
2527
SDImageCodersManager.shared.addCoder(SDImagePDFCoder.shared)
2628
// Dynamic check to support vector format for both WebImage/AnimatedImage

Example/SDWebImageSwiftUIDemo/ContentView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ struct ContentView: View {
7373
"http://littlesvr.ca/apng/images/SteamEngine.webp",
7474
"http://littlesvr.ca/apng/images/world-cup-2014-42.webp",
7575
"https://isparta.github.io/compare-webp/image/gif_webp/webp/2.webp",
76+
"https://raw.githubusercontent.com/link-u/avif-sample-images/master/fox.profile0.8bpc.yuv420.avif",
77+
"https://raw.githubusercontent.com/link-u/avif-sample-images/master/star-12bpc-with-alpha.avifs",
7678
"https://nokiatech.github.io/heif/content/images/ski_jump_1440x960.heic",
7779
"https://nokiatech.github.io/heif/content/image_sequences/starfield_animation.heic",
7880
"https://nr-platform.s3.amazonaws.com/uploads/platform/published_extension/branding_icon/275/AmazonS3.png",

Podfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ def all_pods
66
pod 'SDWebImageWebPCoder'
77
pod 'SDWebImageSVGCoder'
88
pod 'SDWebImagePDFCoder'
9+
pod 'SDWebImageAVIFCoder'
10+
pod 'libavif', :subspecs => ['libdav1d']
911
end
1012

1113
def all_test_pods

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ The best place to put these setup code for SwiftUI App, it's the `AppDelegate.sw
302302
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
303303
// Add WebP/SVG/PDF support
304304
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
305+
SDImageCodersManager.shared.addCoder(SDImageAVIFCoder.shared)
305306
SDImageCodersManager.shared.addCoder(SDImageSVGCoder.shared)
306307
SDImageCodersManager.shared.addCoder(SDImagePDFCoder.shared)
307308

@@ -477,6 +478,8 @@ struct MyApp: App {
477478
SDWebImageManager.defaultImageLoader = SDImageLoadersManager.shared
478479
// WebP support
479480
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
481+
// AVIF support
482+
SDImageCodersManager.shared.addCoder(SDImageAVIFCoder.shared)
480483
}
481484

482485
var body: some Scene {
@@ -716,6 +719,7 @@ Which means, this project is one core use case and downstream dependency, which
716719

717720
- [SDWebImage](https://github.com/SDWebImage/SDWebImage)
718721
- [libwebp](https://github.com/SDWebImage/libwebp-Xcode)
722+
- [libavif](https://github.com/SDWebImage/libavif-Xcode)
719723
- [Kingfisher](https://github.com/onevcat/Kingfisher)
720724
- [SwiftUIX](https://github.com/SwiftUIX/SwiftUIX)
721725
- [Espera](https://github.com/JagCesar/Espera)

0 commit comments

Comments
 (0)