Merge pull request #292 from SDWebImage/example/avif
Update demo to add AVIF test images and AVIF animated images
This commit is contained in:
commit
cf0dc791bc
|
@ -46,7 +46,7 @@ jobs:
|
|||
matrix:
|
||||
iosDestination: ["platform=iOS Simulator,name=iPhone 14 Pro"]
|
||||
tvOSDestination: ["platform=tvOS Simulator,name=Apple TV"]
|
||||
watchOSDestination: ["platform=watchOS Simulator,name=Apple Watch Series 7 (45mm)"]
|
||||
watchOSDestination: ["platform=watchOS Simulator,os=10.0,name=Apple Watch Series 7 (45mm)"]
|
||||
macOSDestination: ["platform=macOS"]
|
||||
macCatalystDestination: ["platform=macOS,variant=Mac Catalyst"]
|
||||
steps:
|
||||
|
|
|
@ -53,8 +53,7 @@
|
|||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES"
|
||||
notificationPayloadFile = "PushNotificationPayload.apns">
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
2
Podfile
2
Podfile
|
@ -6,6 +6,8 @@ def all_pods
|
|||
pod 'SDWebImageWebPCoder'
|
||||
pod 'SDWebImageSVGCoder'
|
||||
pod 'SDWebImagePDFCoder'
|
||||
pod 'SDWebImageAVIFCoder'
|
||||
pod 'libavif', :subspecs => ['libdav1d']
|
||||
end
|
||||
|
||||
def all_test_pods
|
||||
|
|
|
@ -303,6 +303,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)
|
||||
|
||||
|
@ -478,6 +479,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 {
|
||||
|
@ -717,6 +720,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)
|
||||
|
|
Loading…
Reference in New Issue