Update demo to add AVIF test images and AVIF animated images

This commit is contained in:
DreamPiggy 2023-12-28 16:54:39 +08:00
parent 79961a5ac3
commit 9c6349cf32
5 changed files with 11 additions and 2 deletions

View File

@ -53,8 +53,7 @@
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
debugServiceExtension = "internal" debugServiceExtension = "internal"
allowLocationSimulation = "YES" allowLocationSimulation = "YES">
notificationPayloadFile = "PushNotificationPayload.apns">
<BuildableProductRunnable <BuildableProductRunnable
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference

View File

@ -9,6 +9,7 @@
import UIKit import UIKit
import SDWebImage import SDWebImage
import SDWebImageWebPCoder import SDWebImageWebPCoder
import SDWebImageAVIFCoder
import SDWebImageSVGCoder import SDWebImageSVGCoder
import SDWebImagePDFCoder import SDWebImagePDFCoder
@ -21,6 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch. // Override point for customization after application launch.
// Add WebP/SVG/PDF support // Add WebP/SVG/PDF support
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared) SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
SDImageCodersManager.shared.addCoder(SDImageAVIFCoder.shared)
SDImageCodersManager.shared.addCoder(SDImageSVGCoder.shared) SDImageCodersManager.shared.addCoder(SDImageSVGCoder.shared)
SDImageCodersManager.shared.addCoder(SDImagePDFCoder.shared) SDImageCodersManager.shared.addCoder(SDImagePDFCoder.shared)
// Dynamic check to support vector format for both WebImage/AnimatedImage // Dynamic check to support vector format for both WebImage/AnimatedImage

View File

@ -73,6 +73,8 @@ struct ContentView: View {
"http://littlesvr.ca/apng/images/SteamEngine.webp", "http://littlesvr.ca/apng/images/SteamEngine.webp",
"http://littlesvr.ca/apng/images/world-cup-2014-42.webp", "http://littlesvr.ca/apng/images/world-cup-2014-42.webp",
"https://isparta.github.io/compare-webp/image/gif_webp/webp/2.webp", "https://isparta.github.io/compare-webp/image/gif_webp/webp/2.webp",
"https://raw.githubusercontent.com/link-u/avif-sample-images/master/fox.profile0.8bpc.yuv420.avif",
"https://raw.githubusercontent.com/link-u/avif-sample-images/master/star-12bpc-with-alpha.avifs",
"https://nokiatech.github.io/heif/content/images/ski_jump_1440x960.heic", "https://nokiatech.github.io/heif/content/images/ski_jump_1440x960.heic",
"https://nokiatech.github.io/heif/content/image_sequences/starfield_animation.heic", "https://nokiatech.github.io/heif/content/image_sequences/starfield_animation.heic",
"https://nr-platform.s3.amazonaws.com/uploads/platform/published_extension/branding_icon/275/AmazonS3.png", "https://nr-platform.s3.amazonaws.com/uploads/platform/published_extension/branding_icon/275/AmazonS3.png",

View File

@ -6,6 +6,8 @@ def all_pods
pod 'SDWebImageWebPCoder' pod 'SDWebImageWebPCoder'
pod 'SDWebImageSVGCoder' pod 'SDWebImageSVGCoder'
pod 'SDWebImagePDFCoder' pod 'SDWebImagePDFCoder'
pod 'SDWebImageAVIFCoder'
pod 'libavif', :subspecs => ['libdav1d']
end end
def all_test_pods def all_test_pods

View File

@ -302,6 +302,7 @@ The best place to put these setup code for SwiftUI App, it's the `AppDelegate.sw
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Add WebP/SVG/PDF support // Add WebP/SVG/PDF support
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared) SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
SDImageCodersManager.shared.addCoder(SDImageAVIFCoder.shared)
SDImageCodersManager.shared.addCoder(SDImageSVGCoder.shared) SDImageCodersManager.shared.addCoder(SDImageSVGCoder.shared)
SDImageCodersManager.shared.addCoder(SDImagePDFCoder.shared) SDImageCodersManager.shared.addCoder(SDImagePDFCoder.shared)
@ -477,6 +478,8 @@ struct MyApp: App {
SDWebImageManager.defaultImageLoader = SDImageLoadersManager.shared SDWebImageManager.defaultImageLoader = SDImageLoadersManager.shared
// WebP support // WebP support
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared) SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
// AVIF support
SDImageCodersManager.shared.addCoder(SDImageAVIFCoder.shared)
} }
var body: some Scene { var body: some Scene {
@ -716,6 +719,7 @@ Which means, this project is one core use case and downstream dependency, which
- [SDWebImage](https://github.com/SDWebImage/SDWebImage) - [SDWebImage](https://github.com/SDWebImage/SDWebImage)
- [libwebp](https://github.com/SDWebImage/libwebp-Xcode) - [libwebp](https://github.com/SDWebImage/libwebp-Xcode)
- [libavif](https://github.com/SDWebImage/libavif-Xcode)
- [Kingfisher](https://github.com/onevcat/Kingfisher) - [Kingfisher](https://github.com/onevcat/Kingfisher)
- [SwiftUIX](https://github.com/SwiftUIX/SwiftUIX) - [SwiftUIX](https://github.com/SwiftUIX/SwiftUIX)
- [Espera](https://github.com/JagCesar/Espera) - [Espera](https://github.com/JagCesar/Espera)