From 06c6b5f5a5d3b9fb799c68808073d0220fba2e97 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 22 Nov 2019 10:30:01 +0800 Subject: [PATCH] feat:iOS support webp image --- demo/src/ImageDemo.ts | 12 +++++++++ iOS/Doric.podspec | 3 ++- iOS/Example/Podfile.lock | 35 ++++++++++++++++++------- iOS/Pod/Classes/Shader/DoricImageNode.m | 2 +- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/demo/src/ImageDemo.ts b/demo/src/ImageDemo.ts index 272ff6a9..79663335 100644 --- a/demo/src/ImageDemo.ts +++ b/demo/src/ImageDemo.ts @@ -29,6 +29,18 @@ class ImageDemo extends Panel { loadCallback: (ret) => { } }), + label('Animated WebP'), + image({ + imageUrl: "https://p.upyun.com/demo/webp/webp/animated-gif-0.webp", + loadCallback: (ret) => { + } + }), + label('WebP'), + image({ + imageUrl: "https://p.upyun.com/demo/webp/webp/jpg-0.webp", + loadCallback: (ret) => { + } + }), label('ScaleToFill'), image({ imageUrl, diff --git a/iOS/Doric.podspec b/iOS/Doric.podspec index 4e533cf1..918a3f28 100644 --- a/iOS/Doric.podspec +++ b/iOS/Doric.podspec @@ -39,7 +39,8 @@ TODO: Add long description of the pod here. s.public_header_files = 'Pod/Classes/**/*.h' # s.frameworks = 'UIKit', 'MapKit' # s.dependency 'AFNetworking', '~> 2.3' - s.dependency 'SDWebImage', '~> 5.0' + s.dependency 'SDWebImage', '~>4.4.7' + s.dependency 'SDWebImage/WebP' s.dependency 'SocketRocket', '~> 0.5.1' s.dependency 'GCDWebServer', '~> 3.0' end diff --git a/iOS/Example/Podfile.lock b/iOS/Example/Podfile.lock index a41b13c0..fc0a9791 100644 --- a/iOS/Example/Podfile.lock +++ b/iOS/Example/Podfile.lock @@ -1,14 +1,27 @@ PODS: - Doric (0.1.0): - GCDWebServer (~> 3.0) - - SDWebImage (~> 5.0) + - SDWebImage (~> 4.4.7) + - SDWebImage/WebP - SocketRocket (~> 0.5.1) - - GCDWebServer (3.5.2): - - GCDWebServer/Core (= 3.5.2) - - GCDWebServer/Core (3.5.2) - - SDWebImage (5.0.6): - - SDWebImage/Core (= 5.0.6) - - SDWebImage/Core (5.0.6) + - GCDWebServer (3.5.3): + - GCDWebServer/Core (= 3.5.3) + - GCDWebServer/Core (3.5.3) + - libwebp (1.0.3): + - libwebp/demux (= 1.0.3) + - libwebp/mux (= 1.0.3) + - libwebp/webp (= 1.0.3) + - libwebp/demux (1.0.3): + - libwebp/webp + - libwebp/mux (1.0.3): + - libwebp/demux + - libwebp/webp (1.0.3) + - SDWebImage (4.4.7): + - SDWebImage/Core (= 4.4.7) + - SDWebImage/Core (4.4.7) + - SDWebImage/WebP (4.4.7): + - libwebp (< 2.0, >= 0.5) + - SDWebImage/Core - SocketRocket (0.5.1) DEPENDENCIES: @@ -17,6 +30,7 @@ DEPENDENCIES: SPEC REPOS: https://github.com/cocoapods/specs.git: - GCDWebServer + - libwebp - SDWebImage - SocketRocket @@ -25,9 +39,10 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - Doric: f96b77d435e836e88cf02319e3c9ebc08cab65f6 - GCDWebServer: ead88cd14596dd4eae4f5830b8877c87c8728990 - SDWebImage: 920f1a2ff1ca8296ad34f6e0510a1ef1d70ac965 + Doric: 4632b549eb47400496b4aa3307234b883092a77d + GCDWebServer: c0ab22c73e1b84f358d1e2f74bf6afd1c60829f2 + libwebp: 057912d6d0abfb6357d8bb05c0ea470301f5d61e + SDWebImage: c10d14a8883ebd89664f02a422006f66a85c0c5d SocketRocket: d57c7159b83c3c6655745cd15302aa24b6bae531 PODFILE CHECKSUM: 012563d71439e7e33e976dca3b59664ed56cee39 diff --git a/iOS/Pod/Classes/Shader/DoricImageNode.m b/iOS/Pod/Classes/Shader/DoricImageNode.m index dfa204ef..952d6f56 100644 --- a/iOS/Pod/Classes/Shader/DoricImageNode.m +++ b/iOS/Pod/Classes/Shader/DoricImageNode.m @@ -22,7 +22,7 @@ #import "DoricImageNode.h" #import "Doric.h" -#import +#import @interface DoricImageNode () @property(nonatomic, copy) NSString *loadCallbackId;