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"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
notificationPayloadFile = "PushNotificationPayload.apns">
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference

View File

@ -9,6 +9,7 @@
import UIKit
import SDWebImage
import SDWebImageWebPCoder
import SDWebImageAVIFCoder
import SDWebImageSVGCoder
import SDWebImagePDFCoder
@ -21,6 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch.
// Add WebP/SVG/PDF support
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
SDImageCodersManager.shared.addCoder(SDImageAVIFCoder.shared)
SDImageCodersManager.shared.addCoder(SDImageSVGCoder.shared)
SDImageCodersManager.shared.addCoder(SDImagePDFCoder.shared)
// 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/world-cup-2014-42.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/image_sequences/starfield_animation.heic",
"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 'SDWebImageSVGCoder'
pod 'SDWebImagePDFCoder'
pod 'SDWebImageAVIFCoder'
pod 'libavif', :subspecs => ['libdav1d']
end
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 {
// Add WebP/SVG/PDF support
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
SDImageCodersManager.shared.addCoder(SDImageAVIFCoder.shared)
SDImageCodersManager.shared.addCoder(SDImageSVGCoder.shared)
SDImageCodersManager.shared.addCoder(SDImagePDFCoder.shared)
@ -477,6 +478,8 @@ struct MyApp: App {
SDWebImageManager.defaultImageLoader = SDImageLoadersManager.shared
// WebP support
SDImageCodersManager.shared.addCoder(SDImageWebPCoder.shared)
// AVIF support
SDImageCodersManager.shared.addCoder(SDImageAVIFCoder.shared)
}
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)
- [libwebp](https://github.com/SDWebImage/libwebp-Xcode)
- [libavif](https://github.com/SDWebImage/libavif-Xcode)
- [Kingfisher](https://github.com/onevcat/Kingfisher)
- [SwiftUIX](https://github.com/SwiftUIX/SwiftUIX)
- [Espera](https://github.com/JagCesar/Espera)