Move webp component (and libwebp dependency) to SDWebImage/SDWebImageWebPCoder
- move the webp component + the libwebp dependency to SDWebImage/SDWebImageWebPCoder (including tests and demo) - Xcode 9.4 - instead of directly linking the Demos to the frameworks, using CocoaPods (`Examples/Podfile`). This allows using SDWebImage/SDWebImageWebPCoder into our examples so we keep the WebP demos - demos code cleanup and warnings resolved - all links from docs (README, Migration guide, CHANGELOG) are full links, so they work even from external pages (i.e. https://cocoapods.org/pods/SDWebImage). - added "Additional modules" section to README
This commit is contained in:
parent
f22a69891c
commit
64123734c3
|
@ -1,3 +0,0 @@
|
|||
[submodule "Vendors/libwebp"]
|
||||
path = Vendors/libwebp
|
||||
url = https://github.com/webmproject/libwebp
|
|
@ -38,7 +38,11 @@ script:
|
|||
- xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage tvOS' -sdk appletvsimulator -configuration Debug | xcpretty -c
|
||||
- xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage watchOS' -sdk watchsimulator -configuration Debug | xcpretty -c
|
||||
|
||||
- echo Clean DerivedData
|
||||
- rm -rf ~/Library/Developer/Xcode/DerivedData
|
||||
|
||||
- echo Build the Demo apps
|
||||
- pod install --project-directory=Examples
|
||||
- xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage OSX Demo' -sdk macosx -configuration Debug | xcpretty -c
|
||||
- xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage iOS Demo' -configuration Debug -destination 'name=iPhone 8' | xcpretty -c
|
||||
- xcodebuild build -workspace SDWebImage.xcworkspace -scheme 'SDWebImage TV Demo' -sdk appletvsimulator -configuration Debug | xcpretty -c
|
||||
|
|
|
@ -61,7 +61,7 @@ See [all tickets marked for the 5.0.0 release](https://github.com/rs/SDWebImage/
|
|||
|
||||
#### Backwards incompatible changes
|
||||
|
||||
See the [5.0 Migration Guide](Docs/SDWebImage-5.0-Migration-guide.md) for a list of comprehensive changes and the way to update your code
|
||||
See the [5.0 Migration Guide](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/SDWebImage-5.0-Migration-guide.md) for a list of comprehensive changes and the way to update your code
|
||||
|
||||
#### Features
|
||||
- Introduce `SDAnimatedImageView`, `SDAnimatedImage` and refactor the way we handle animated images #2140
|
||||
|
|
|
@ -215,5 +215,5 @@ In SDWebImage 5.0 we did a clean up of the API. We are using many modern Objecti
|
|||
- `sd_currentAlternateImageURL()` changed to `sd_currentAlternateImageURL`
|
||||
|
||||
### Full API Diff
|
||||
For advanced user who need the detailed API diff, we provide the full diff in a HTML web page: [SDWebImage 5.0 API Diff](https://raw.githubusercontent.com/rs/SDWebImage/master/Docs/Diff/5.0/apidiff.html)
|
||||
For advanced user who need the detailed API diff, we provide the full diff in a HTML web page: [SDWebImage 5.0 API Diff](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/API-Diff/5.0/apidiff.html)
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
|
||||
use_frameworks!
|
||||
|
||||
project 'SDWebImage Demo'
|
||||
workspace '../SDWebImage'
|
||||
|
||||
pod 'SDWebImage/Core', :path => '../'
|
||||
pod 'SDWebImageWebPCoder', :git => 'https://github.com/SDWebImage/SDWebImageWebPCoder.git', :branch => 'master'
|
||||
|
||||
target 'SDWebImage iOS Demo' do
|
||||
platform :ios, '8.0'
|
||||
end
|
||||
|
||||
target 'SDWebImage OSX Demo' do
|
||||
platform :osx, '10.10'
|
||||
end
|
||||
|
||||
target 'SDWebImage TV Demo' do
|
||||
platform :tvos, '9.2'
|
||||
end
|
||||
|
||||
target 'SDWebImage Watch Demo Extension' do
|
||||
platform :watchos, '2.0'
|
||||
end
|
|
@ -7,17 +7,11 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
327E2DCD1FAF0D6A00EF52C2 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43A0FAAF1BDD16AC00B7582B /* SDWebImage.framework */; };
|
||||
327E2DCE1FAF0D6A00EF52C2 /* SDWebImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 43A0FAAF1BDD16AC00B7582B /* SDWebImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
327E2DD21FAF0D7000EF52C2 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43A629E71D0DFD000089D7DD /* SDWebImage.framework */; };
|
||||
327E2DD31FAF0D7000EF52C2 /* SDWebImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 43A629E71D0DFD000089D7DD /* SDWebImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
327E2DD71FAF0D7900EF52C2 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4397D2751D0DDBE100BB2784 /* SDWebImage.framework */; };
|
||||
327E2DD81FAF0D7900EF52C2 /* SDWebImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4397D2751D0DDBE100BB2784 /* SDWebImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
327E2DDC1FAF0D8000EF52C2 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 431739601CDFCC370008FEB9 /* SDWebImage.framework */; };
|
||||
327E2DDD1FAF0D8000EF52C2 /* SDWebImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 431739601CDFCC370008FEB9 /* SDWebImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
1DFFF782AC680AB174A297D2 /* Pods_SDWebImage_Watch_Demo_Extension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C2FAC73C40132154E469AC8 /* Pods_SDWebImage_Watch_Demo_Extension.framework */; };
|
||||
32892E311FAE898C00BE8320 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 32892E301FAE898C00BE8320 /* Assets.xcassets */; };
|
||||
32892E351FAE89FE00BE8320 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32892E341FAE89FD00BE8320 /* LaunchScreen.storyboard */; };
|
||||
3E75A9861742DBE700DA412D /* CustomPathImages in Resources */ = {isa = PBXBuildFile; fileRef = 3E75A9851742DBE700DA412D /* CustomPathImages */; };
|
||||
3EB94398122E15A03521242D /* Pods_SDWebImage_iOS_Demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E1C7793F375A90B31F03087 /* Pods_SDWebImage_iOS_Demo.framework */; };
|
||||
4314D1AA1D0E1181004B36C9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4314D1A91D0E1181004B36C9 /* main.m */; };
|
||||
4314D1AD1D0E1181004B36C9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4314D1AC1D0E1181004B36C9 /* AppDelegate.m */; };
|
||||
4314D1B01D0E1182004B36C9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4314D1AF1D0E1182004B36C9 /* ViewController.m */; };
|
||||
|
@ -46,101 +40,12 @@
|
|||
537612B0155AB74D005750A4 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 537612AF155AB74D005750A4 /* DetailViewController.m */; };
|
||||
537612B3155AB74D005750A4 /* MasterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 537612B1155AB74D005750A4 /* MasterViewController.xib */; };
|
||||
537612B6155AB74D005750A4 /* DetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 537612B4155AB74D005750A4 /* DetailViewController.xib */; };
|
||||
A335B6482715CD923F929224 /* Pods_SDWebImage_OSX_Demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AFF4102E3D959CBB4FA13AB0 /* Pods_SDWebImage_OSX_Demo.framework */; };
|
||||
AB731AD9445BC0E9EA4F353C /* Pods_SDWebImage_TV_Demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92719CCA7C38F5667B582562 /* Pods_SDWebImage_TV_Demo.framework */; };
|
||||
DA248D44195470FD00390AB0 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 537612E3155ABA3C005750A4 /* MapKit.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
327E2DAE1FAF0A6B00EF52C2 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 431BB6891D06D2C1006A3455;
|
||||
remoteInfo = "SDWebImage watchOS";
|
||||
};
|
||||
327E2DB31FAF0B3800EF52C2 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 4A2CADFE1AB4BB5300B6BC39;
|
||||
remoteInfo = "SDWebImage iOS";
|
||||
};
|
||||
327E2DCF1FAF0D6A00EF52C2 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 4A2CADFE1AB4BB5300B6BC39;
|
||||
remoteInfo = "SDWebImage iOS";
|
||||
};
|
||||
327E2DD41FAF0D7000EF52C2 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 4397D2761D0DDD8C00BB2784;
|
||||
remoteInfo = "SDWebImage OSX";
|
||||
};
|
||||
327E2DD91FAF0D7900EF52C2 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 431BB6891D06D2C1006A3455;
|
||||
remoteInfo = "SDWebImage watchOS";
|
||||
};
|
||||
327E2DDE1FAF0D8000EF52C2 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 00733A4B1BC487C000A5A117;
|
||||
remoteInfo = "SDWebImage tvOS";
|
||||
};
|
||||
4314D19D1D0E0EB6004B36C9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 4314D1991D0E0E3B004B36C9;
|
||||
remoteInfo = "SDWebImage watchOS static";
|
||||
};
|
||||
4314D1BA1D0E11A0004B36C9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 00733A4B1BC487C000A5A117;
|
||||
remoteInfo = "SDWebImage tvOS";
|
||||
};
|
||||
4317395F1CDFCC370008FEB9 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 00733A4C1BC487C000A5A117;
|
||||
remoteInfo = "WebImage tvOS";
|
||||
};
|
||||
4397D2741D0DDBE100BB2784 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 431BB7031D06D2C1006A3455;
|
||||
remoteInfo = "SDWebImage watchOS";
|
||||
};
|
||||
43A0FAAE1BDD16AC00B7582B /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 4A2CADFF1AB4BB5300B6BC39;
|
||||
remoteInfo = WebImage;
|
||||
};
|
||||
43A629E61D0DFD000089D7DD /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 4397D2F21D0DDD8C00BB2784;
|
||||
remoteInfo = "SDWebImage OSX";
|
||||
};
|
||||
43A629E91D0DFDCA0089D7DD /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 4397D2761D0DDD8C00BB2784;
|
||||
remoteInfo = "SDWebImage OSX";
|
||||
};
|
||||
43A629FC1D0E07600089D7DD /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 5376128C155AB74D005750A4 /* Project object */;
|
||||
|
@ -155,13 +60,6 @@
|
|||
remoteGlobalIDString = 43A629ED1D0E07600089D7DD;
|
||||
remoteInfo = "SDWebImage Watch Demo";
|
||||
};
|
||||
DA248D731954841D00390AB0 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 53761325155AD0D5005750A4;
|
||||
remoteInfo = SDWebImage;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
|
@ -171,7 +69,6 @@
|
|||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
327E2DCE1FAF0D6A00EF52C2 /* SDWebImage.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -182,7 +79,6 @@
|
|||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
327E2DD31FAF0D7000EF52C2 /* SDWebImage.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -193,7 +89,6 @@
|
|||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
327E2DD81FAF0D7900EF52C2 /* SDWebImage.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -204,7 +99,6 @@
|
|||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
327E2DDD1FAF0D8000EF52C2 /* SDWebImage.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -234,8 +128,14 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0A5C1B2C88218143A5BCB306 /* Pods-SDWebImage OSX Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImage OSX Demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SDWebImage OSX Demo/Pods-SDWebImage OSX Demo.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
1E1C7793F375A90B31F03087 /* Pods_SDWebImage_iOS_Demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDWebImage_iOS_Demo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1E3938BD7F1865D9C3421374 /* Pods-SDWebImage iOS Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImage iOS Demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SDWebImage iOS Demo/Pods-SDWebImage iOS Demo.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
201B6D833246D81FC96576AF /* Pods_SDWebImage_Watch_Demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDWebImage_Watch_Demo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3027DFFB4B050C9E195FC1E6 /* Pods-SDWebImage TV Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImage TV Demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-SDWebImage TV Demo/Pods-SDWebImage TV Demo.release.xcconfig"; sourceTree = "<group>"; };
|
||||
32892E301FAE898C00BE8320 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
32892E341FAE89FD00BE8320 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
3C2FAC73C40132154E469AC8 /* Pods_SDWebImage_Watch_Demo_Extension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDWebImage_Watch_Demo_Extension.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3E75A9851742DBE700DA412D /* CustomPathImages */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CustomPathImages; sourceTree = SOURCE_ROOT; };
|
||||
4314D1A61D0E1181004B36C9 /* SDWebImage TV Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SDWebImage TV Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4314D1A91D0E1181004B36C9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
|
@ -286,7 +186,13 @@
|
|||
537612B5155AB74D005750A4 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DetailViewController.xib; sourceTree = "<group>"; };
|
||||
537612E3155ABA3C005750A4 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; };
|
||||
537612E6155ABA44005750A4 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
|
||||
DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDWebImage.xcodeproj; path = ../SDWebImage.xcodeproj; sourceTree = "<group>"; };
|
||||
92719CCA7C38F5667B582562 /* Pods_SDWebImage_TV_Demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDWebImage_TV_Demo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
9B2818BFAE3E61037805BB0A /* Pods-SDWebImage Watch Demo Extension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImage Watch Demo Extension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SDWebImage Watch Demo Extension/Pods-SDWebImage Watch Demo Extension.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
AFF4102E3D959CBB4FA13AB0 /* Pods_SDWebImage_OSX_Demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SDWebImage_OSX_Demo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C78C49F71ED2172D9252509F /* Pods-SDWebImage iOS Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImage iOS Demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-SDWebImage iOS Demo/Pods-SDWebImage iOS Demo.release.xcconfig"; sourceTree = "<group>"; };
|
||||
CC928213A59B58D86A2040DD /* Pods-SDWebImage TV Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImage TV Demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SDWebImage TV Demo/Pods-SDWebImage TV Demo.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
E0B6B3418BA8A3EA9217E79A /* Pods-SDWebImage Watch Demo Extension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImage Watch Demo Extension.release.xcconfig"; path = "Pods/Target Support Files/Pods-SDWebImage Watch Demo Extension/Pods-SDWebImage Watch Demo Extension.release.xcconfig"; sourceTree = "<group>"; };
|
||||
FF1B0E74870E1C8DD6DBF631 /* Pods-SDWebImage OSX Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SDWebImage OSX Demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-SDWebImage OSX Demo/Pods-SDWebImage OSX Demo.release.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -294,7 +200,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
327E2DDC1FAF0D8000EF52C2 /* SDWebImage.framework in Frameworks */,
|
||||
AB731AD9445BC0E9EA4F353C /* Pods_SDWebImage_TV_Demo.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -302,7 +208,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
327E2DD21FAF0D7000EF52C2 /* SDWebImage.framework in Frameworks */,
|
||||
A335B6482715CD923F929224 /* Pods_SDWebImage_OSX_Demo.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -310,7 +216,7 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
327E2DD71FAF0D7900EF52C2 /* SDWebImage.framework in Frameworks */,
|
||||
1DFFF782AC680AB174A297D2 /* Pods_SDWebImage_Watch_Demo_Extension.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -322,8 +228,15 @@
|
|||
531041C1157EAC8F00BBABC3 /* ImageIO.framework in Frameworks */,
|
||||
5376129A155AB74D005750A4 /* UIKit.framework in Frameworks */,
|
||||
5376129C155AB74D005750A4 /* Foundation.framework in Frameworks */,
|
||||
327E2DCD1FAF0D6A00EF52C2 /* SDWebImage.framework in Frameworks */,
|
||||
5376129E155AB74D005750A4 /* CoreGraphics.framework in Frameworks */,
|
||||
3EB94398122E15A03521242D /* Pods_SDWebImage_iOS_Demo.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
A3F8A0092FB9960BF0FFE3E0 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -413,7 +326,6 @@
|
|||
5376128A155AB74D005750A4 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */,
|
||||
5376129F155AB74D005750A4 /* SDWebImage Demo */,
|
||||
43A629D01D0DFD000089D7DD /* SDWebImage OSX Demo */,
|
||||
43A629EF1D0E07600089D7DD /* SDWebImage Watch Demo */,
|
||||
|
@ -421,6 +333,7 @@
|
|||
4314D1A71D0E1181004B36C9 /* SDWebImage TV Demo */,
|
||||
53761298155AB74D005750A4 /* Frameworks */,
|
||||
53761296155AB74D005750A4 /* Products */,
|
||||
C5D3D7AE3B6CBC7C43AE7833 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
|
@ -444,6 +357,11 @@
|
|||
53761299155AB74D005750A4 /* UIKit.framework */,
|
||||
5376129B155AB74D005750A4 /* Foundation.framework */,
|
||||
5376129D155AB74D005750A4 /* CoreGraphics.framework */,
|
||||
1E1C7793F375A90B31F03087 /* Pods_SDWebImage_iOS_Demo.framework */,
|
||||
AFF4102E3D959CBB4FA13AB0 /* Pods_SDWebImage_OSX_Demo.framework */,
|
||||
201B6D833246D81FC96576AF /* Pods_SDWebImage_Watch_Demo.framework */,
|
||||
92719CCA7C38F5667B582562 /* Pods_SDWebImage_TV_Demo.framework */,
|
||||
3C2FAC73C40132154E469AC8 /* Pods_SDWebImage_Watch_Demo_Extension.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
|
@ -477,17 +395,19 @@
|
|||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DA248D6D1954841D00390AB0 /* Products */ = {
|
||||
C5D3D7AE3B6CBC7C43AE7833 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DA248D741954841D00390AB0 /* libSDWebImage iOS static.a */,
|
||||
4314D19E1D0E0EB6004B36C9 /* libSDWebImage watchOS static.a */,
|
||||
43A0FAAF1BDD16AC00B7582B /* SDWebImage.framework */,
|
||||
431739601CDFCC370008FEB9 /* SDWebImage.framework */,
|
||||
4397D2751D0DDBE100BB2784 /* SDWebImage.framework */,
|
||||
43A629E71D0DFD000089D7DD /* SDWebImage.framework */,
|
||||
1E3938BD7F1865D9C3421374 /* Pods-SDWebImage iOS Demo.debug.xcconfig */,
|
||||
C78C49F71ED2172D9252509F /* Pods-SDWebImage iOS Demo.release.xcconfig */,
|
||||
0A5C1B2C88218143A5BCB306 /* Pods-SDWebImage OSX Demo.debug.xcconfig */,
|
||||
FF1B0E74870E1C8DD6DBF631 /* Pods-SDWebImage OSX Demo.release.xcconfig */,
|
||||
CC928213A59B58D86A2040DD /* Pods-SDWebImage TV Demo.debug.xcconfig */,
|
||||
3027DFFB4B050C9E195FC1E6 /* Pods-SDWebImage TV Demo.release.xcconfig */,
|
||||
9B2818BFAE3E61037805BB0A /* Pods-SDWebImage Watch Demo Extension.debug.xcconfig */,
|
||||
E0B6B3418BA8A3EA9217E79A /* Pods-SDWebImage Watch Demo Extension.release.xcconfig */,
|
||||
);
|
||||
name = Products;
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
@ -497,16 +417,16 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 4314D1B71D0E1182004B36C9 /* Build configuration list for PBXNativeTarget "SDWebImage TV Demo" */;
|
||||
buildPhases = (
|
||||
C1A2E0ED98B257BB14D9BD35 /* [CP] Check Pods Manifest.lock */,
|
||||
4314D1A21D0E1181004B36C9 /* Sources */,
|
||||
4314D1A31D0E1181004B36C9 /* Frameworks */,
|
||||
4314D1A41D0E1181004B36C9 /* Resources */,
|
||||
327E2DE01FAF0D8000EF52C2 /* Embed Frameworks */,
|
||||
30CA4D7A6B97CD11FB023FCD /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
4314D1BB1D0E11A0004B36C9 /* PBXTargetDependency */,
|
||||
327E2DDF1FAF0D8000EF52C2 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "SDWebImage TV Demo";
|
||||
productName = "SDWebImage TV Demo";
|
||||
|
@ -517,16 +437,16 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 43A629E81D0DFD000089D7DD /* Build configuration list for PBXNativeTarget "SDWebImage OSX Demo" */;
|
||||
buildPhases = (
|
||||
E6792144F5EDB318B9B3E808 /* [CP] Check Pods Manifest.lock */,
|
||||
43A629CB1D0DFD000089D7DD /* Sources */,
|
||||
43A629CC1D0DFD000089D7DD /* Frameworks */,
|
||||
43A629CD1D0DFD000089D7DD /* Resources */,
|
||||
327E2DD61FAF0D7000EF52C2 /* Embed Frameworks */,
|
||||
D3795F96D778EA0D160C99E0 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
43A629EA1D0DFDCA0089D7DD /* PBXTargetDependency */,
|
||||
327E2DD51FAF0D7000EF52C2 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "SDWebImage OSX Demo";
|
||||
productName = "SDWebImage OSX Demo";
|
||||
|
@ -539,6 +459,7 @@
|
|||
buildPhases = (
|
||||
43A629EC1D0E07600089D7DD /* Resources */,
|
||||
43A62A131D0E07600089D7DD /* Embed App Extensions */,
|
||||
A3F8A0092FB9960BF0FFE3E0 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
|
@ -554,16 +475,16 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 43A62A101D0E07600089D7DD /* Build configuration list for PBXNativeTarget "SDWebImage Watch Demo Extension" */;
|
||||
buildPhases = (
|
||||
845ACCC963F0540C3714E294 /* [CP] Check Pods Manifest.lock */,
|
||||
43A629F61D0E07600089D7DD /* Sources */,
|
||||
43A629F71D0E07600089D7DD /* Frameworks */,
|
||||
43A629F81D0E07600089D7DD /* Resources */,
|
||||
327E2DDB1FAF0D7A00EF52C2 /* Embed Frameworks */,
|
||||
D108C032EF2001F3466266B0 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
327E2DAF1FAF0A6B00EF52C2 /* PBXTargetDependency */,
|
||||
327E2DDA1FAF0D7900EF52C2 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "SDWebImage Watch Demo Extension";
|
||||
productName = "SDWebImage Watch Demo Extension";
|
||||
|
@ -574,18 +495,18 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 537612B9155AB74D005750A4 /* Build configuration list for PBXNativeTarget "SDWebImage iOS Demo" */;
|
||||
buildPhases = (
|
||||
C4617CE0275D471FCDB0F0BF /* [CP] Check Pods Manifest.lock */,
|
||||
53761291155AB74D005750A4 /* Sources */,
|
||||
53761292155AB74D005750A4 /* Frameworks */,
|
||||
53761293155AB74D005750A4 /* Resources */,
|
||||
43A62A171D0E07600089D7DD /* Embed Watch Content */,
|
||||
327E2DD11FAF0D6A00EF52C2 /* Embed Frameworks */,
|
||||
AEB35AD7EBE9525CAF4048E9 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
43A62A0E1D0E07600089D7DD /* PBXTargetDependency */,
|
||||
327E2DB41FAF0B3800EF52C2 /* PBXTargetDependency */,
|
||||
327E2DD01FAF0D6A00EF52C2 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "SDWebImage iOS Demo";
|
||||
productName = "SDWebImage Demo";
|
||||
|
@ -598,7 +519,7 @@
|
|||
5376128C155AB74D005750A4 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0900;
|
||||
LastUpgradeCheck = 0940;
|
||||
ORGANIZATIONNAME = Dailymotion;
|
||||
TargetAttributes = {
|
||||
4314D1A51D0E1181004B36C9 = {
|
||||
|
@ -626,12 +547,6 @@
|
|||
mainGroup = 5376128A155AB74D005750A4;
|
||||
productRefGroup = 53761296155AB74D005750A4 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = DA248D6D1954841D00390AB0 /* Products */;
|
||||
ProjectRef = DA248D6C1954841D00390AB0 /* SDWebImage.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
53761294155AB74D005750A4 /* SDWebImage iOS Demo */,
|
||||
|
@ -643,51 +558,6 @@
|
|||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
4314D19E1D0E0EB6004B36C9 /* libSDWebImage watchOS static.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libSDWebImage watchOS static.a";
|
||||
remoteRef = 4314D19D1D0E0EB6004B36C9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
431739601CDFCC370008FEB9 /* SDWebImage.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = SDWebImage.framework;
|
||||
remoteRef = 4317395F1CDFCC370008FEB9 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
4397D2751D0DDBE100BB2784 /* SDWebImage.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = SDWebImage.framework;
|
||||
remoteRef = 4397D2741D0DDBE100BB2784 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
43A0FAAF1BDD16AC00B7582B /* SDWebImage.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = SDWebImage.framework;
|
||||
remoteRef = 43A0FAAE1BDD16AC00B7582B /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
43A629E71D0DFD000089D7DD /* SDWebImage.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = SDWebImage.framework;
|
||||
remoteRef = 43A629E61D0DFD000089D7DD /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
DA248D741954841D00390AB0 /* libSDWebImage iOS static.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libSDWebImage iOS static.a";
|
||||
remoteRef = DA248D731954841D00390AB0 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
4314D1A41D0E1181004B36C9 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
|
@ -738,6 +608,177 @@
|
|||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
30CA4D7A6B97CD11FB023FCD /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImage TV Demo/Pods-SDWebImage TV Demo-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImage-tvOS/SDWebImage.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder-tvOS/SDWebImageWebPCoder.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/libwebp-tvOS/libwebp.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImage TV Demo/Pods-SDWebImage TV Demo-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
845ACCC963F0540C3714E294 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-SDWebImage Watch Demo Extension-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
AEB35AD7EBE9525CAF4048E9 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImage iOS Demo/Pods-SDWebImage iOS Demo-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImage-iOS/SDWebImage.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder-iOS/SDWebImageWebPCoder.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/libwebp-iOS/libwebp.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImage iOS Demo/Pods-SDWebImage iOS Demo-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
C1A2E0ED98B257BB14D9BD35 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-SDWebImage TV Demo-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
C4617CE0275D471FCDB0F0BF /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-SDWebImage iOS Demo-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
D108C032EF2001F3466266B0 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImage Watch Demo Extension/Pods-SDWebImage Watch Demo Extension-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImage-watchOS/SDWebImage.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder-watchOS/SDWebImageWebPCoder.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/libwebp-watchOS/libwebp.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImage Watch Demo Extension/Pods-SDWebImage Watch Demo Extension-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
D3795F96D778EA0D160C99E0 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImage OSX Demo/Pods-SDWebImage OSX Demo-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImage-macOS/SDWebImage.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder-macOS/SDWebImageWebPCoder.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/libwebp-macOS/libwebp.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImage OSX Demo/Pods-SDWebImage OSX Demo-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
E6792144F5EDB318B9B3E808 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-SDWebImage OSX Demo-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
4314D1A21D0E1181004B36C9 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
|
@ -783,46 +824,6 @@
|
|||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
327E2DAF1FAF0A6B00EF52C2 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "SDWebImage watchOS";
|
||||
targetProxy = 327E2DAE1FAF0A6B00EF52C2 /* PBXContainerItemProxy */;
|
||||
};
|
||||
327E2DB41FAF0B3800EF52C2 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "SDWebImage iOS";
|
||||
targetProxy = 327E2DB31FAF0B3800EF52C2 /* PBXContainerItemProxy */;
|
||||
};
|
||||
327E2DD01FAF0D6A00EF52C2 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "SDWebImage iOS";
|
||||
targetProxy = 327E2DCF1FAF0D6A00EF52C2 /* PBXContainerItemProxy */;
|
||||
};
|
||||
327E2DD51FAF0D7000EF52C2 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "SDWebImage OSX";
|
||||
targetProxy = 327E2DD41FAF0D7000EF52C2 /* PBXContainerItemProxy */;
|
||||
};
|
||||
327E2DDA1FAF0D7900EF52C2 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "SDWebImage watchOS";
|
||||
targetProxy = 327E2DD91FAF0D7900EF52C2 /* PBXContainerItemProxy */;
|
||||
};
|
||||
327E2DDF1FAF0D8000EF52C2 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "SDWebImage tvOS";
|
||||
targetProxy = 327E2DDE1FAF0D8000EF52C2 /* PBXContainerItemProxy */;
|
||||
};
|
||||
4314D1BB1D0E11A0004B36C9 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "SDWebImage tvOS";
|
||||
targetProxy = 4314D1BA1D0E11A0004B36C9 /* PBXContainerItemProxy */;
|
||||
};
|
||||
43A629EA1D0DFDCA0089D7DD /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "SDWebImage OSX";
|
||||
targetProxy = 43A629E91D0DFDCA0089D7DD /* PBXContainerItemProxy */;
|
||||
};
|
||||
43A629FD1D0E07600089D7DD /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 43A629F91D0E07600089D7DD /* SDWebImage Watch Demo Extension */;
|
||||
|
@ -881,6 +882,7 @@
|
|||
/* Begin XCBuildConfiguration section */
|
||||
4314D1B81D0E1182004B36C9 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = CC928213A59B58D86A2040DD /* Pods-SDWebImage TV Demo.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
|
@ -920,6 +922,7 @@
|
|||
};
|
||||
4314D1B91D0E1182004B36C9 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 3027DFFB4B050C9E195FC1E6 /* Pods-SDWebImage TV Demo.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
|
@ -961,6 +964,7 @@
|
|||
};
|
||||
43A629E01D0DFD000089D7DD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 0A5C1B2C88218143A5BCB306 /* Pods-SDWebImage OSX Demo.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
|
@ -1000,6 +1004,7 @@
|
|||
};
|
||||
43A629E11D0DFD000089D7DD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = FF1B0E74870E1C8DD6DBF631 /* Pods-SDWebImage OSX Demo.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
|
@ -1041,6 +1046,7 @@
|
|||
};
|
||||
43A62A111D0E07600089D7DD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9B2818BFAE3E61037805BB0A /* Pods-SDWebImage Watch Demo Extension.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
|
@ -1080,6 +1086,7 @@
|
|||
};
|
||||
43A62A121D0E07600089D7DD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = E0B6B3418BA8A3EA9217E79A /* Pods-SDWebImage Watch Demo Extension.release.xcconfig */;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
|
@ -1208,11 +1215,13 @@
|
|||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
|
@ -1252,11 +1261,13 @@
|
|||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
|
@ -1282,6 +1293,7 @@
|
|||
};
|
||||
537612BA155AB74D005750A4 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 1E3938BD7F1865D9C3421374 /* Pods-SDWebImage iOS Demo.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
|
@ -1292,7 +1304,6 @@
|
|||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "SDWebImage Demo/SDWebImage Demo-Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"\"$(OBJROOT)/UninstalledProducts/include\"",
|
||||
"\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
|
||||
|
@ -1300,8 +1311,6 @@
|
|||
INFOPLIST_FILE = "SDWebImage Demo/SDWebImage Demo-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
|
@ -1311,6 +1320,7 @@
|
|||
};
|
||||
537612BB155AB74D005750A4 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C78C49F71ED2172D9252509F /* Pods-SDWebImage iOS Demo.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
|
@ -1321,7 +1331,6 @@
|
|||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "SDWebImage Demo/SDWebImage Demo-Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"\"$(OBJROOT)/UninstalledProducts/include\"",
|
||||
"\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
|
||||
|
@ -1329,7 +1338,6 @@
|
|||
INFOPLIST_FILE = "SDWebImage Demo/SDWebImage Demo-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.dailymotion.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -46,7 +45,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -46,7 +45,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -54,7 +54,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -74,7 +73,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
|
||||
@implementation DetailViewController
|
||||
|
||||
- (void)configureView
|
||||
{
|
||||
- (void)configureView {
|
||||
if (!self.imageView.sd_imageIndicator) {
|
||||
self.imageView.sd_imageIndicator = SDWebImageProgressIndicator.defaultIndicator;
|
||||
}
|
||||
|
@ -27,15 +26,9 @@
|
|||
options:SDWebImageProgressiveLoad];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self configureView];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#import "MasterViewController.h"
|
||||
#import "DetailViewController.h"
|
||||
#import <SDWebImage/SDWebImage.h>
|
||||
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>
|
||||
|
||||
@interface MyCustomTableViewCell : UITableViewCell
|
||||
|
||||
|
@ -42,17 +43,17 @@
|
|||
|
||||
@implementation MasterViewController
|
||||
|
||||
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self)
|
||||
{
|
||||
if (self) {
|
||||
self.title = @"SDWebImage";
|
||||
self.navigationItem.rightBarButtonItem = [UIBarButtonItem.alloc initWithTitle:@"Clear Cache"
|
||||
style:UIBarButtonItemStylePlain
|
||||
target:self
|
||||
action:@selector(flushCache)];
|
||||
|
||||
[[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]];
|
||||
|
||||
// HTTP NTLM auth example
|
||||
// Add your NTLM image url to the array below and replace the credentials
|
||||
[SDWebImageDownloader sharedDownloader].config.username = @"httpwatch";
|
||||
|
@ -78,35 +79,25 @@
|
|||
for (int i=0; i<100; i++) {
|
||||
[self.objects addObject:[NSString stringWithFormat:@"https://s3.amazonaws.com/fast-image-cache/demo-images/FICDDemoImage%03d.jpg", i]];
|
||||
}
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)flushCache
|
||||
{
|
||||
- (void)flushCache {
|
||||
[SDWebImageManager.sharedManager.imageCache clearWithCacheType:SDImageCacheTypeAll completion:nil];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
|
||||
}
|
||||
|
||||
#pragma mark - Table View
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.objects.count;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
static NSString *CellIdentifier = @"Cell";
|
||||
|
||||
static UIImage *placeholderImage = nil;
|
||||
|
@ -128,8 +119,7 @@
|
|||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSString *largeImageURLString = [self.objects[indexPath.row] stringByReplacingOccurrencesOfString:@"small" withString:@"source"];
|
||||
NSURL *largeImageURL = [NSURL URLWithString:largeImageURLString];
|
||||
DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#import "ViewController.h"
|
||||
#import <SDWebImage/SDWebImage.h>
|
||||
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>
|
||||
|
||||
@interface ViewController ()
|
||||
|
||||
|
@ -24,6 +25,8 @@
|
|||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]];
|
||||
|
||||
// For animated GIF rendering, set `animates` to YES or will only show the first frame
|
||||
self.imageView2.animates = YES; // `SDAnimatedImageRep` can be used for built-in `NSImageView` to support better GIF & APNG rendering as well. No need `SDAnimatedImageView`
|
||||
self.imageView3.animates = YES;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#import "ViewController.h"
|
||||
#import <SDWebImage/SDWebImage.h>
|
||||
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>
|
||||
|
||||
@interface ViewController ()
|
||||
|
||||
|
@ -24,6 +25,7 @@
|
|||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
[[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]];
|
||||
|
||||
[self.imageView1 sd_setImageWithURL:[NSURL URLWithString:@"http://s3.amazonaws.com/fast-image-cache/demo-images/FICDDemoImage001.jpg"]];
|
||||
[self.imageView2 sd_setImageWithURL:[NSURL URLWithString:@"http://www.ioncannon.net/wp-content/uploads/2011/06/test2.webp"]];
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#import "InterfaceController.h"
|
||||
#import <SDWebImage/SDWebImage.h>
|
||||
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>
|
||||
|
||||
|
||||
@interface InterfaceController()
|
||||
|
@ -23,6 +24,7 @@
|
|||
[super awakeWithContext:context];
|
||||
|
||||
// Configure interface objects here.
|
||||
[[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]];
|
||||
}
|
||||
|
||||
- (void)willActivate {
|
||||
|
|
|
@ -36,28 +36,6 @@
|
|||
[super didDeactivate];
|
||||
}
|
||||
|
||||
/*
|
||||
- (void)didReceiveLocalNotification:(UILocalNotification *)localNotification withCompletion:(void (^)(WKUserNotificationInterfaceType))completionHandler {
|
||||
// This method is called when a local notification needs to be presented.
|
||||
// Implement it if you use a dynamic notification interface.
|
||||
// Populate your dynamic notification interface as quickly as possible.
|
||||
//
|
||||
// After populating your dynamic notification interface call the completion block.
|
||||
completionHandler(WKUserNotificationInterfaceTypeCustom);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
- (void)didReceiveRemoteNotification:(NSDictionary *)remoteNotification withCompletion:(void (^)(WKUserNotificationInterfaceType))completionHandler {
|
||||
// This method is called when a remote notification needs to be presented.
|
||||
// Implement it if you use a dynamic notification interface.
|
||||
// Populate your dynamic notification interface as quickly as possible.
|
||||
//
|
||||
// After populating your dynamic notification interface call the completion block.
|
||||
completionHandler(WKUserNotificationInterfaceTypeCustom);
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
58
README.md
58
README.md
|
@ -1,5 +1,5 @@
|
|||
<p align="center" >
|
||||
<img src="SDWebImage_logo.png" title="SDWebImage logo" float=left>
|
||||
<img src="https://raw.githubusercontent.com/rs/SDWebImage/master/SDWebImage_logo.png" title="SDWebImage logo" float=left>
|
||||
</p>
|
||||
|
||||
|
||||
|
@ -32,7 +32,31 @@ This library provides an async image downloader with cache support. For convenie
|
|||
## Supported Image Formats
|
||||
|
||||
- Image formats supported by UIImage (JPEG, PNG, ...), including GIF
|
||||
- WebP format, including animated WebP (use the `WebP` subspec)
|
||||
- WebP format, including animated WebP (use the [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) project)
|
||||
|
||||
## Additional modules
|
||||
|
||||
In order to keep SDWebImage focused and limited to the core features, but also allow extensibility and custom behaviors, during the 5.0 refactoring we focused on modularizing the library.
|
||||
As such, we have moved/built new modules to [SDWebImage org](https://github.com/SDWebImage).
|
||||
|
||||
#### Coders for additional image formats
|
||||
- [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) - coder for WebP image format. Based on [libwebp](https://chromium.googlesource.com/webm/libwebp)
|
||||
- [SDWebImageHEIFCoder](https://github.com/SDWebImage/SDWebImageHEIFCoder) - coder to support HEIF image without Apple's `Image/IO framework`
|
||||
- [SDWebImageAPNGCoder](https://github.com/SDWebImage/SDWebImageAPNGCoder) - coder for APNG format (animated PNG)
|
||||
- [SDWebImageBPGCoder](https://github.com/SDWebImage/SDWebImageBPGCoder) - coder for BPG format
|
||||
|
||||
#### Loaders
|
||||
- [SDWebImagePhotosPlugin](https://github.com/SDWebImage/SDWebImagePhotosPlugin) - plugin to support loading images from Photos (using `Photos.framework`)
|
||||
|
||||
#### Integration with 3rd party libraries
|
||||
- [SDWebImageFLPlugin](https://github.com/SDWebImage/SDWebImageFLPlugin) - plugin to support [FLAnimatedImage](https://github.com/Flipboard/FLAnimatedImage) as the engine for animated GIFs
|
||||
- [SDWebImageYYPlugin](https://github.com/SDWebImage/SDWebImageYYPlugin) - plugin to integrate [YYImage](https://github.com/ibireme/YYImage) & [YYCache](https://github.com/ibireme/YYCache) for image rendering & caching
|
||||
- [SDWebImageProgressiveJPEGDemo](https://github.com/SDWebImage/SDWebImageProgressiveJPEGDemo) - demo project for using `SDWebImage` + [Concorde library](https://github.com/contentful-labs/Concorde) for Progressive JPEG decoding
|
||||
|
||||
#### Make our lives easier
|
||||
- [libwebp-Xcode](https://github.com/SDWebImage/libwebp-Xcode) - A wrapper for [libwebp](https://chromium.googlesource.com/webm/libwebp) + an Xcode project.
|
||||
|
||||
You can use those directly, or create similar components of your own.
|
||||
|
||||
## Requirements
|
||||
|
||||
|
@ -56,8 +80,8 @@ This library provides an async image downloader with cache support. For convenie
|
|||
- Read the [Documentation @ CocoaDocs](http://cocoadocs.org/docsets/SDWebImage/)
|
||||
- Try the example by downloading the project from Github or even easier using CocoaPods try `pod try SDWebImage`
|
||||
- Read the [Installation Guide](https://github.com/rs/SDWebImage/wiki/Installation-Guide)
|
||||
- Read the [SDWebImage 5.0 Migration Guide](Docs/SDWebImage-5.0-Migration-guide.md) to get an idea of the changes from 4.x to 5.x
|
||||
- Read the [SDWebImage 4.0 Migration Guide](Docs/SDWebImage-4.0-Migration-guide.md) to get an idea of the changes from 3.x to 4.x
|
||||
- Read the [SDWebImage 5.0 Migration Guide](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/SDWebImage-5.0-Migration-guide.md) to get an idea of the changes from 4.x to 5.x
|
||||
- Read the [SDWebImage 4.0 Migration Guide](https://raw.githubusercontent.com/rs/SDWebImage/master/Docs/SDWebImage-4.0-Migration-guide.md) to get an idea of the changes from 3.x to 4.x
|
||||
- Read the [Common Problems](https://github.com/rs/SDWebImage/wiki/Common-Problems) to find the solution for common problems
|
||||
- Go to the [Wiki Page](https://github.com/rs/SDWebImage/wiki) for more information such as [Advanced Usage](https://github.com/rs/SDWebImage/wiki/Advanced-Usage)
|
||||
|
||||
|
@ -70,7 +94,7 @@ This library provides an async image downloader with cache support. For convenie
|
|||
- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/sdwebimage).
|
||||
- If you **found a bug**, open an issue.
|
||||
- If you **have a feature request**, open an issue.
|
||||
- If you **want to contribute**, submit a pull request.
|
||||
- If you **want to contribute**, read the [Contributing Guide](https://raw.githubusercontent.com/rs/SDWebImage/master/.github/CONTRIBUTING.md)
|
||||
|
||||
## How To Use
|
||||
|
||||
|
@ -91,7 +115,7 @@ import SDWebImage
|
|||
imageView.sd_setImage(with: URL(string: "http://www.domain.com/path/to/image.jpg"), placeholderImage: UIImage(named: "placeholder.png"))
|
||||
```
|
||||
|
||||
- For details about how to use the library and clear examples, see [The detailed How to use](Docs/HowToUse.md)
|
||||
- For details about how to use the library and clear examples, see [The detailed How to use](https://raw.githubusercontent.com/rs/SDWebImage/master/Docs/HowToUse.md)
|
||||
|
||||
## Animated Images (GIF) support
|
||||
|
||||
|
@ -126,11 +150,11 @@ use_frameworks!
|
|||
|
||||
#### Subspecs
|
||||
|
||||
There are 3 subspecs available now: `Core`, `MapKit` and `WebP` (this means you can install only some of the SDWebImage modules. By default, you get just `Core`, so if you need `WebP`, you need to specify it).
|
||||
There are 2 subspecs available now: `Core` and `MapKit` (this means you can install only some of the SDWebImage modules. By default, you get just `Core`, so if you need `MapKit`, you need to specify it).
|
||||
|
||||
Podfile example:
|
||||
```
|
||||
pod 'SDWebImage/WebP'
|
||||
pod 'SDWebImage/MapKit'
|
||||
```
|
||||
|
||||
### Installation with Carthage (iOS 8+)
|
||||
|
@ -145,7 +169,7 @@ github "rs/SDWebImage"
|
|||
```
|
||||
|
||||
### Installation by cloning the repository
|
||||
- see [Manual install](Docs/ManualInstallation.md)
|
||||
- see [Manual install](https://raw.githubusercontent.com/rs/SDWebImage/master/Docs/ManualInstallation.md)
|
||||
|
||||
### Import headers in your source files
|
||||
|
||||
|
@ -178,26 +202,26 @@ All source code is licensed under the [MIT License](https://raw.github.com/rs/SD
|
|||
|
||||
#### High Level Diagram
|
||||
<p align="center" >
|
||||
<img src="Docs/Diagrams/SDWebImageHighLevelDiagram.jpeg" title="SDWebImage high level diagram">
|
||||
<img src="https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageHighLevelDiagram.jpeg" title="SDWebImage high level diagram">
|
||||
</p>
|
||||
|
||||
#### Overall Class Diagram
|
||||
<p align="center" >
|
||||
<img src="Docs/Diagrams/SDWebImageClassDiagram.png" title="SDWebImage overall class diagram">
|
||||
<img src="https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageClassDiagram.png" title="SDWebImage overall class diagram">
|
||||
</p>
|
||||
|
||||
#### Top Level API Diagram
|
||||
<p align="center" >
|
||||
<img src="Docs/Diagrams/SDWebImageTopLevelClassDiagram.png" title="SDWebImage top level API diagram">
|
||||
<img src="https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageTopLevelClassDiagram.png" title="SDWebImage top level API diagram">
|
||||
</p>
|
||||
|
||||
#### Main Sequence Diagram
|
||||
<p align="center" >
|
||||
<img src="Docs/Diagrams/SDWebImageSequenceDiagram.png" title="SDWebImage sequence diagram">
|
||||
<img src="https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageSequenceDiagram.png" title="SDWebImage sequence diagram">
|
||||
</p>
|
||||
|
||||
#### More detailed diagrams
|
||||
- [Manager API Diagram](Docs/Diagrams/SDWebImageManagerClassDiagram.png)
|
||||
- [Coders API Diagram](Docs/Diagrams/SDWebImageCodersClassDiagram.png)
|
||||
- [Loader API Diagram](Docs/Diagrams/SDWebImageLoaderClassDiagram.png)
|
||||
- [Cache API Diagram](Docs/Diagrams/SDWebImageCacheClassDiagram.png)
|
||||
- [Manager API Diagram](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageManagerClassDiagram.png)
|
||||
- [Coders API Diagram](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageCodersClassDiagram.png)
|
||||
- [Loader API Diagram](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageLoaderClassDiagram.png)
|
||||
- [Cache API Diagram](https://raw.githubusercontent.com/rs/SDWebImage/5.x/Docs/Diagrams/SDWebImageCacheClassDiagram.png)
|
||||
|
|
|
@ -29,7 +29,7 @@ Pod::Spec.new do |s|
|
|||
|
||||
s.subspec 'Core' do |core|
|
||||
core.source_files = 'SDWebImage/*.{h,m}', 'WebImage/SDWebImage.h'
|
||||
core.exclude_files = 'SDWebImage/MapKit/*.{h,m}', 'SDWebImage/WebP/*.{h,m}'
|
||||
core.exclude_files = 'SDWebImage/MapKit/*.{h,m}'
|
||||
end
|
||||
|
||||
s.subspec 'MapKit' do |mk|
|
||||
|
@ -40,18 +40,4 @@ Pod::Spec.new do |s|
|
|||
mk.framework = 'MapKit'
|
||||
mk.dependency 'SDWebImage/Core'
|
||||
end
|
||||
|
||||
s.subspec 'WebP' do |webp|
|
||||
webp.source_files = 'SDWebImage/WebP/*.{h,m}'
|
||||
webp.xcconfig = {
|
||||
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SD_WEBP=1',
|
||||
'USER_HEADER_SEARCH_PATHS' => '$(inherited) $(SRCROOT)/libwebp/src'
|
||||
}
|
||||
webp.watchos.xcconfig = {
|
||||
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SD_WEBP=1 WEBP_USE_INTRINSICS=1',
|
||||
'USER_HEADER_SEARCH_PATHS' => '$(inherited) $(SRCROOT)/libwebp/src'
|
||||
}
|
||||
webp.dependency 'SDWebImage/Core'
|
||||
webp.dependency 'libwebp', '~> 0.5'
|
||||
end
|
||||
end
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -37,7 +36,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -37,7 +36,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -37,7 +36,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -37,7 +36,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -37,7 +36,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -37,7 +36,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Examples/../SDWebImage.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Examples/SDWebImage Demo.xcodeproj">
|
||||
</FileRef>
|
||||
|
@ -25,4 +28,7 @@
|
|||
<FileRef
|
||||
location = "group:Tests/Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Examples/Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -46,7 +45,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
Note: the `coders` getter will return the coders in their reversed order
|
||||
Example:
|
||||
- by default we internally set coders = `IOCoder`, `GIFCoder`, `APNGCoder` and `WebPCoder` (When WebP subspec is available).
|
||||
- calling `coders` will return `@[WebPCoder, IOCoder]`
|
||||
- by default we internally set coders = `IOCoder`, `GIFCoder`
|
||||
- calling `coders` will return `@[IOCoder, GIFCoder]`
|
||||
- call `[addCoder:[MyCrazyCoder new]]`
|
||||
- calling `coders` now returns `@[MyCrazyCoder, WebPCoder, IOCoder]`
|
||||
- calling `coders` now returns `@[MyCrazyCoder, IOCoder, GIFCoder]`
|
||||
|
||||
Coders
|
||||
------
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
#import "SDImageIOCoder.h"
|
||||
#import "SDImageGIFCoder.h"
|
||||
#import "SDImageAPNGCoder.h"
|
||||
#ifdef SD_WEBP
|
||||
#import "SDImageWebPCoder.h"
|
||||
#endif
|
||||
|
||||
@interface SDImageCodersManager ()
|
||||
|
||||
|
@ -35,9 +32,6 @@
|
|||
if (self = [super init]) {
|
||||
// initialize with default coders
|
||||
NSMutableArray<id<SDImageCoder>> *mutableCoders = [@[[SDImageIOCoder sharedCoder], [SDImageGIFCoder sharedCoder], [SDImageAPNGCoder sharedCoder]] mutableCopy];
|
||||
#ifdef SD_WEBP
|
||||
[mutableCoders addObject:[SDImageWebPCoder sharedCoder]];
|
||||
#endif
|
||||
_coders = [mutableCoders copy];
|
||||
_codersLock = dispatch_semaphore_create(1);
|
||||
}
|
||||
|
|
|
@ -112,11 +112,7 @@ static void * SDWebImageDownloaderContext = &SDWebImageDownloaderContext;
|
|||
}
|
||||
headerDictionary[@"User-Agent"] = userAgent;
|
||||
}
|
||||
#ifdef SD_WEBP
|
||||
headerDictionary[@"Accept"] = @"image/webp,image/*;q=0.8";
|
||||
#else
|
||||
headerDictionary[@"Accept"] = @"image/*;q=0.8";
|
||||
#endif
|
||||
_HTTPHeaders = [headerDictionary copy];
|
||||
_operationsLock = dispatch_semaphore_create(1);
|
||||
NSURLSessionConfiguration *sessionConfiguration = _config.sessionConfiguration;
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
/*
|
||||
* This file is part of the SDWebImage package.
|
||||
* (c) Olivier Poitrey <rs@dailymotion.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
#ifdef SD_WEBP
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SDImageCoder.h"
|
||||
|
||||
/**
|
||||
Built in coder that supports WebP and animated WebP
|
||||
*/
|
||||
@interface SDImageWebPCoder : NSObject <SDProgressiveImageCoder, SDAnimatedImageCoder>
|
||||
|
||||
@property (nonatomic, class, readonly, nonnull) SDImageWebPCoder *sharedCoder;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,827 +0,0 @@
|
|||
/*
|
||||
* This file is part of the SDWebImage package.
|
||||
* (c) Olivier Poitrey <rs@dailymotion.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
#ifdef SD_WEBP
|
||||
|
||||
#import "SDImageWebPCoder.h"
|
||||
#import "SDImageCoderHelper.h"
|
||||
#import "NSImage+Compatibility.h"
|
||||
#import "UIImage+Metadata.h"
|
||||
#import "UIImage+ForceDecode.h"
|
||||
#if __has_include(<webp/decode.h>) && __has_include(<webp/encode.h>) && __has_include(<webp/demux.h>) && __has_include(<webp/mux.h>)
|
||||
#import <webp/decode.h>
|
||||
#import <webp/encode.h>
|
||||
#import <webp/demux.h>
|
||||
#import <webp/mux.h>
|
||||
#else
|
||||
#import "webp/decode.h"
|
||||
#import "webp/encode.h"
|
||||
#import "webp/demux.h"
|
||||
#import "webp/mux.h"
|
||||
#endif
|
||||
#import <Accelerate/Accelerate.h>
|
||||
|
||||
@interface SDWebPCoderFrame : NSObject
|
||||
|
||||
@property (nonatomic, assign) NSUInteger index; // Frame index (zero based)
|
||||
@property (nonatomic, assign) NSTimeInterval duration; // Frame duration in seconds
|
||||
@property (nonatomic, assign) NSUInteger width; // Frame width
|
||||
@property (nonatomic, assign) NSUInteger height; // Frame height
|
||||
@property (nonatomic, assign) NSUInteger offsetX; // Frame origin.x in canvas (left-bottom based)
|
||||
@property (nonatomic, assign) NSUInteger offsetY; // Frame origin.y in canvas (left-bottom based)
|
||||
@property (nonatomic, assign) BOOL hasAlpha; // Whether frame contains alpha
|
||||
@property (nonatomic, assign) BOOL isFullSize; // Whether frame size is equal to canvas size
|
||||
@property (nonatomic, assign) WebPMuxAnimBlend blend; // Frame dispose method
|
||||
@property (nonatomic, assign) WebPMuxAnimDispose dispose; // Frame blend operation
|
||||
@property (nonatomic, assign) NSUInteger blendFromIndex; // The nearest previous frame index which blend mode is WEBP_MUX_BLEND
|
||||
|
||||
@end
|
||||
|
||||
@implementation SDWebPCoderFrame
|
||||
@end
|
||||
|
||||
@implementation SDImageWebPCoder {
|
||||
WebPIDecoder *_idec;
|
||||
WebPDemuxer *_demux;
|
||||
NSData *_imageData;
|
||||
CGFloat _scale;
|
||||
NSUInteger _loopCount;
|
||||
NSUInteger _frameCount;
|
||||
NSArray<SDWebPCoderFrame *> *_frames;
|
||||
CGContextRef _canvas;
|
||||
BOOL _hasAnimation;
|
||||
BOOL _hasAlpha;
|
||||
BOOL _finished;
|
||||
CGFloat _canvasWidth;
|
||||
CGFloat _canvasHeight;
|
||||
dispatch_semaphore_t _lock;
|
||||
NSUInteger _currentBlendIndex;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
if (_idec) {
|
||||
WebPIDelete(_idec);
|
||||
_idec = NULL;
|
||||
}
|
||||
if (_demux) {
|
||||
WebPDemuxDelete(_demux);
|
||||
_demux = NULL;
|
||||
}
|
||||
if (_canvas) {
|
||||
CGContextRelease(_canvas);
|
||||
_canvas = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
+ (instancetype)sharedCoder {
|
||||
static SDImageWebPCoder *coder;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
coder = [[SDImageWebPCoder alloc] init];
|
||||
});
|
||||
return coder;
|
||||
}
|
||||
|
||||
#pragma mark - Decode
|
||||
- (BOOL)canDecodeFromData:(nullable NSData *)data {
|
||||
return ([NSData sd_imageFormatForImageData:data] == SDImageFormatWebP);
|
||||
}
|
||||
|
||||
- (BOOL)canIncrementalDecodeFromData:(NSData *)data {
|
||||
return ([NSData sd_imageFormatForImageData:data] == SDImageFormatWebP);
|
||||
}
|
||||
|
||||
- (UIImage *)decodedImageWithData:(NSData *)data options:(nullable SDImageCoderOptions *)options {
|
||||
if (!data) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
WebPData webpData;
|
||||
WebPDataInit(&webpData);
|
||||
webpData.bytes = data.bytes;
|
||||
webpData.size = data.length;
|
||||
WebPDemuxer *demuxer = WebPDemux(&webpData);
|
||||
if (!demuxer) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
uint32_t flags = WebPDemuxGetI(demuxer, WEBP_FF_FORMAT_FLAGS);
|
||||
BOOL hasAnimation = flags & ANIMATION_FLAG;
|
||||
BOOL decodeFirstFrame = [options[SDImageCoderDecodeFirstFrameOnly] boolValue];
|
||||
CGFloat scale = 1;
|
||||
NSNumber *scaleFactor = options[SDImageCoderDecodeScaleFactor];
|
||||
if (scaleFactor != nil) {
|
||||
scale = [scaleFactor doubleValue];
|
||||
if (scale < 1) {
|
||||
scale = 1;
|
||||
}
|
||||
}
|
||||
if (!hasAnimation) {
|
||||
// for static single webp image
|
||||
CGImageRef imageRef = [self sd_createWebpImageWithData:webpData];
|
||||
if (!imageRef) {
|
||||
return nil;
|
||||
}
|
||||
#if SD_UIKIT || SD_WATCH
|
||||
UIImage *staticImage = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp];
|
||||
#else
|
||||
UIImage *staticImage = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:kCGImagePropertyOrientationUp];
|
||||
#endif
|
||||
CGImageRelease(imageRef);
|
||||
WebPDemuxDelete(demuxer);
|
||||
return staticImage;
|
||||
}
|
||||
|
||||
// for animated webp image
|
||||
WebPIterator iter;
|
||||
// libwebp's index start with 1
|
||||
if (!WebPDemuxGetFrame(demuxer, 1, &iter)) {
|
||||
WebPDemuxReleaseIterator(&iter);
|
||||
WebPDemuxDelete(demuxer);
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (decodeFirstFrame) {
|
||||
// first frame for animated webp image
|
||||
CGImageRef imageRef = [self sd_createWebpImageWithData:iter.fragment];
|
||||
#if SD_UIKIT || SD_WATCH
|
||||
UIImage *firstFrameImage = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp];
|
||||
#else
|
||||
UIImage *firstFrameImage = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:kCGImagePropertyOrientationUp];
|
||||
#endif
|
||||
firstFrameImage.sd_imageFormat = SDImageFormatWebP;
|
||||
CGImageRelease(imageRef);
|
||||
WebPDemuxReleaseIterator(&iter);
|
||||
WebPDemuxDelete(demuxer);
|
||||
return firstFrameImage;
|
||||
}
|
||||
|
||||
int loopCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT);
|
||||
int canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH);
|
||||
int canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT);
|
||||
BOOL hasAlpha = flags & ALPHA_FLAG;
|
||||
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Host;
|
||||
bitmapInfo |= hasAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst;
|
||||
CGContextRef canvas = CGBitmapContextCreate(NULL, canvasWidth, canvasHeight, 8, 0, [SDImageCoderHelper colorSpaceGetDeviceRGB], bitmapInfo);
|
||||
if (!canvas) {
|
||||
WebPDemuxDelete(demuxer);
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSMutableArray<SDImageFrame *> *frames = [NSMutableArray array];
|
||||
|
||||
do {
|
||||
@autoreleasepool {
|
||||
CGImageRef imageRef = [self sd_drawnWebpImageWithCanvas:canvas iterator:iter];
|
||||
if (!imageRef) {
|
||||
continue;
|
||||
}
|
||||
#if SD_UIKIT || SD_WATCH
|
||||
UIImage *image = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp];
|
||||
#else
|
||||
UIImage *image = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:kCGImagePropertyOrientationUp];
|
||||
#endif
|
||||
CGImageRelease(imageRef);
|
||||
|
||||
NSTimeInterval duration = [self sd_frameDurationWithIterator:iter];
|
||||
SDImageFrame *frame = [SDImageFrame frameWithImage:image duration:duration];
|
||||
[frames addObject:frame];
|
||||
}
|
||||
|
||||
} while (WebPDemuxNextFrame(&iter));
|
||||
|
||||
WebPDemuxReleaseIterator(&iter);
|
||||
WebPDemuxDelete(demuxer);
|
||||
CGContextRelease(canvas);
|
||||
|
||||
UIImage *animatedImage = [SDImageCoderHelper animatedImageWithFrames:frames];
|
||||
animatedImage.sd_imageLoopCount = loopCount;
|
||||
animatedImage.sd_imageFormat = SDImageFormatWebP;
|
||||
|
||||
return animatedImage;
|
||||
}
|
||||
|
||||
#pragma mark - Progressive Decode
|
||||
- (instancetype)initIncrementalWithOptions:(nullable SDImageCoderOptions *)options {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
// Progressive images need transparent, so always use premultiplied BGRA
|
||||
_idec = WebPINewRGB(MODE_bgrA, NULL, 0, 0);
|
||||
CGFloat scale = 1;
|
||||
NSNumber *scaleFactor = options[SDImageCoderDecodeScaleFactor];
|
||||
if (scaleFactor != nil) {
|
||||
scale = [scaleFactor doubleValue];
|
||||
if (scale < 1) {
|
||||
scale = 1;
|
||||
}
|
||||
}
|
||||
_scale = scale;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)updateIncrementalData:(NSData *)data finished:(BOOL)finished {
|
||||
if (_finished) {
|
||||
return;
|
||||
}
|
||||
_imageData = data;
|
||||
_finished = finished;
|
||||
VP8StatusCode status = WebPIUpdate(_idec, data.bytes, data.length);
|
||||
if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) {
|
||||
return;
|
||||
}
|
||||
// libwebp current does not support progressive decoding for animated image, so no need to scan and update the frame information
|
||||
}
|
||||
|
||||
- (UIImage *)incrementalDecodedImageWithOptions:(SDImageCoderOptions *)options {
|
||||
UIImage *image;
|
||||
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
int last_y = 0;
|
||||
int stride = 0;
|
||||
uint8_t *rgba = WebPIDecGetRGB(_idec, &last_y, &width, &height, &stride);
|
||||
// last_y may be 0, means no enough bitmap data to decode, ignore this
|
||||
if (width + height > 0 && last_y > 0 && height >= last_y) {
|
||||
// Construct a UIImage from the decoded RGBA value array
|
||||
size_t rgbaSize = last_y * stride;
|
||||
CGDataProviderRef provider =
|
||||
CGDataProviderCreateWithData(NULL, rgba, rgbaSize, NULL);
|
||||
CGColorSpaceRef colorSpaceRef = [SDImageCoderHelper colorSpaceGetDeviceRGB];
|
||||
|
||||
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst;
|
||||
size_t components = 4;
|
||||
CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
|
||||
// Why to use last_y for image height is because of libwebp's bug (https://bugs.chromium.org/p/webp/issues/detail?id=362)
|
||||
// It will not keep memory barrier safe on x86 architechure (macOS & iPhone simulator) but on ARM architecture (iPhone & iPad & tv & watch) it works great
|
||||
// If different threads use WebPIDecGetRGB to grab rgba bitmap, it will contain the previous decoded bitmap data
|
||||
// So this will cause our drawed image looks strange(above is the current part but below is the previous part)
|
||||
// We only grab the last_y height and draw the last_y height instead of total height image
|
||||
// Besides fix, this can enhance performance since we do not need to create extra bitmap
|
||||
CGImageRef imageRef = CGImageCreate(width, last_y, 8, components * 8, components * width, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent);
|
||||
|
||||
CGDataProviderRelease(provider);
|
||||
|
||||
if (!imageRef) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
CGContextRef canvas = CGBitmapContextCreate(NULL, width, height, 8, 0, [SDImageCoderHelper colorSpaceGetDeviceRGB], bitmapInfo);
|
||||
if (!canvas) {
|
||||
CGImageRelease(imageRef);
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Only draw the last_y image height, keep remains transparent, in Core Graphics coordinate system
|
||||
CGContextDrawImage(canvas, CGRectMake(0, height - last_y, width, last_y), imageRef);
|
||||
CGImageRef newImageRef = CGBitmapContextCreateImage(canvas);
|
||||
CGImageRelease(imageRef);
|
||||
if (!newImageRef) {
|
||||
CGContextRelease(canvas);
|
||||
return nil;
|
||||
}
|
||||
CGFloat scale = _scale;
|
||||
NSNumber *scaleFactor = options[SDImageCoderDecodeScaleFactor];
|
||||
if (scaleFactor != nil) {
|
||||
scale = [scaleFactor doubleValue];
|
||||
if (scale < 1) {
|
||||
scale = 1;
|
||||
}
|
||||
}
|
||||
|
||||
#if SD_UIKIT || SD_WATCH
|
||||
image = [[UIImage alloc] initWithCGImage:newImageRef scale:scale orientation:UIImageOrientationUp];
|
||||
#else
|
||||
image = [[UIImage alloc] initWithCGImage:newImageRef scale:scale orientation:kCGImagePropertyOrientationUp];
|
||||
#endif
|
||||
image.sd_isDecoded = YES; // Already drawn on bitmap context above
|
||||
image.sd_imageFormat = SDImageFormatWebP;
|
||||
CGImageRelease(newImageRef);
|
||||
CGContextRelease(canvas);
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
- (void)sd_blendWebpImageWithCanvas:(CGContextRef)canvas iterator:(WebPIterator)iter {
|
||||
size_t canvasHeight = CGBitmapContextGetHeight(canvas);
|
||||
CGFloat tmpX = iter.x_offset;
|
||||
CGFloat tmpY = canvasHeight - iter.height - iter.y_offset;
|
||||
CGRect imageRect = CGRectMake(tmpX, tmpY, iter.width, iter.height);
|
||||
|
||||
if (iter.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND) {
|
||||
CGContextClearRect(canvas, imageRect);
|
||||
} else {
|
||||
CGImageRef imageRef = [self sd_createWebpImageWithData:iter.fragment];
|
||||
if (!imageRef) {
|
||||
return;
|
||||
}
|
||||
BOOL shouldBlend = iter.blend_method == WEBP_MUX_BLEND;
|
||||
// If not blend, cover the target image rect. (firstly clear then draw)
|
||||
if (!shouldBlend) {
|
||||
CGContextClearRect(canvas, imageRect);
|
||||
}
|
||||
CGContextDrawImage(canvas, imageRect, imageRef);
|
||||
CGImageRelease(imageRef);
|
||||
}
|
||||
}
|
||||
|
||||
- (nullable CGImageRef)sd_drawnWebpImageWithCanvas:(CGContextRef)canvas iterator:(WebPIterator)iter CF_RETURNS_RETAINED {
|
||||
CGImageRef imageRef = [self sd_createWebpImageWithData:iter.fragment];
|
||||
if (!imageRef) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
size_t canvasHeight = CGBitmapContextGetHeight(canvas);
|
||||
CGFloat tmpX = iter.x_offset;
|
||||
CGFloat tmpY = canvasHeight - iter.height - iter.y_offset;
|
||||
CGRect imageRect = CGRectMake(tmpX, tmpY, iter.width, iter.height);
|
||||
BOOL shouldBlend = iter.blend_method == WEBP_MUX_BLEND;
|
||||
|
||||
// If not blend, cover the target image rect. (firstly clear then draw)
|
||||
if (!shouldBlend) {
|
||||
CGContextClearRect(canvas, imageRect);
|
||||
}
|
||||
CGContextDrawImage(canvas, imageRect, imageRef);
|
||||
CGImageRef newImageRef = CGBitmapContextCreateImage(canvas);
|
||||
|
||||
CGImageRelease(imageRef);
|
||||
|
||||
if (iter.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND) {
|
||||
CGContextClearRect(canvas, imageRect);
|
||||
}
|
||||
|
||||
return newImageRef;
|
||||
}
|
||||
|
||||
- (nullable CGImageRef)sd_createWebpImageWithData:(WebPData)webpData CF_RETURNS_RETAINED {
|
||||
WebPDecoderConfig config;
|
||||
if (!WebPInitDecoderConfig(&config)) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (WebPGetFeatures(webpData.bytes, webpData.size, &config.input) != VP8_STATUS_OK) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
BOOL hasAlpha = config.input.has_alpha;
|
||||
// iOS prefer BGRA8888 (premultiplied) or BGRX8888 bitmapInfo for screen rendering, which is same as `UIGraphicsBeginImageContext()` or `- [CALayer drawInContext:]`
|
||||
// use this bitmapInfo, combined with right colorspace, even without decode, can still avoid extra CA::Render::copy_image(which marked `Color Copied Images` from Instruments)
|
||||
WEBP_CSP_MODE colorspace = MODE_bgrA;
|
||||
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Host;
|
||||
bitmapInfo |= hasAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst;
|
||||
config.options.use_threads = 1;
|
||||
config.output.colorspace = colorspace;
|
||||
|
||||
// Decode the WebP image data into a RGBA value array
|
||||
if (WebPDecode(webpData.bytes, webpData.size, &config) != VP8_STATUS_OK) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
int width = config.input.width;
|
||||
int height = config.input.height;
|
||||
if (config.options.use_scaling) {
|
||||
width = config.options.scaled_width;
|
||||
height = config.options.scaled_height;
|
||||
}
|
||||
|
||||
// Construct a UIImage from the decoded RGBA value array
|
||||
CGDataProviderRef provider =
|
||||
CGDataProviderCreateWithData(NULL, config.output.u.RGBA.rgba, config.output.u.RGBA.size, FreeImageData);
|
||||
size_t bitsPerComponent = 8;
|
||||
size_t bitsPerPixel = 32;
|
||||
size_t bytesPerRow = config.output.u.RGBA.stride;
|
||||
CGColorSpaceRef colorSpaceRef = [SDImageCoderHelper colorSpaceGetDeviceRGB];
|
||||
CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
|
||||
CGImageRef imageRef = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent);
|
||||
|
||||
CGDataProviderRelease(provider);
|
||||
|
||||
return imageRef;
|
||||
}
|
||||
|
||||
- (NSTimeInterval)sd_frameDurationWithIterator:(WebPIterator)iter {
|
||||
int duration = iter.duration;
|
||||
if (duration <= 10) {
|
||||
// WebP standard says 0 duration is used for canvas updating but not showing image, but actually Chrome and other implementations set it to 100ms if duration is lower or equal than 10ms
|
||||
// Some animated WebP images also created without duration, we should keep compatibility
|
||||
duration = 100;
|
||||
}
|
||||
return duration / 1000.0;
|
||||
}
|
||||
|
||||
#pragma mark - Encode
|
||||
- (BOOL)canEncodeToFormat:(SDImageFormat)format {
|
||||
return (format == SDImageFormatWebP);
|
||||
}
|
||||
|
||||
- (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format options:(nullable SDImageCoderOptions *)options {
|
||||
if (!image) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSData *data;
|
||||
|
||||
double compressionQuality = 1;
|
||||
if (options[SDImageCoderEncodeCompressionQuality]) {
|
||||
compressionQuality = [options[SDImageCoderEncodeCompressionQuality] doubleValue];
|
||||
}
|
||||
NSArray<SDImageFrame *> *frames = [SDImageCoderHelper framesFromAnimatedImage:image];
|
||||
|
||||
BOOL encodeFirstFrame = [options[SDImageCoderEncodeFirstFrameOnly] boolValue];
|
||||
if (encodeFirstFrame || frames.count == 0) {
|
||||
// for static single webp image
|
||||
data = [self sd_encodedWebpDataWithImage:image quality:compressionQuality];
|
||||
} else {
|
||||
// for animated webp image
|
||||
WebPMux *mux = WebPMuxNew();
|
||||
if (!mux) {
|
||||
return nil;
|
||||
}
|
||||
for (size_t i = 0; i < frames.count; i++) {
|
||||
SDImageFrame *currentFrame = frames[i];
|
||||
NSData *webpData = [self sd_encodedWebpDataWithImage:currentFrame.image quality:compressionQuality];
|
||||
int duration = currentFrame.duration * 1000;
|
||||
WebPMuxFrameInfo frame = { .bitstream.bytes = webpData.bytes,
|
||||
.bitstream.size = webpData.length,
|
||||
.duration = duration,
|
||||
.id = WEBP_CHUNK_ANMF,
|
||||
.dispose_method = WEBP_MUX_DISPOSE_BACKGROUND, // each frame will clear canvas
|
||||
.blend_method = WEBP_MUX_NO_BLEND
|
||||
};
|
||||
if (WebPMuxPushFrame(mux, &frame, 0) != WEBP_MUX_OK) {
|
||||
WebPMuxDelete(mux);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
int loopCount = (int)image.sd_imageLoopCount;
|
||||
WebPMuxAnimParams params = { .bgcolor = 0,
|
||||
.loop_count = loopCount
|
||||
};
|
||||
if (WebPMuxSetAnimationParams(mux, ¶ms) != WEBP_MUX_OK) {
|
||||
WebPMuxDelete(mux);
|
||||
return nil;
|
||||
}
|
||||
|
||||
WebPData outputData;
|
||||
WebPMuxError error = WebPMuxAssemble(mux, &outputData);
|
||||
WebPMuxDelete(mux);
|
||||
if (error != WEBP_MUX_OK) {
|
||||
return nil;
|
||||
}
|
||||
data = [NSData dataWithBytes:outputData.bytes length:outputData.size];
|
||||
WebPDataClear(&outputData);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
- (nullable NSData *)sd_encodedWebpDataWithImage:(nullable UIImage *)image quality:(double)quality {
|
||||
if (!image) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSData *webpData;
|
||||
CGImageRef imageRef = image.CGImage;
|
||||
|
||||
size_t width = CGImageGetWidth(imageRef);
|
||||
size_t height = CGImageGetHeight(imageRef);
|
||||
if (width == 0 || width > WEBP_MAX_DIMENSION) {
|
||||
return nil;
|
||||
}
|
||||
if (height == 0 || height > WEBP_MAX_DIMENSION) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
size_t bytesPerRow = CGImageGetBytesPerRow(imageRef);
|
||||
CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
|
||||
CGImageAlphaInfo alphaInfo = bitmapInfo & kCGBitmapAlphaInfoMask;
|
||||
CGBitmapInfo byteOrderInfo = bitmapInfo & kCGBitmapByteOrderMask;
|
||||
BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone ||
|
||||
alphaInfo == kCGImageAlphaNoneSkipFirst ||
|
||||
alphaInfo == kCGImageAlphaNoneSkipLast);
|
||||
BOOL byteOrderNormal = NO;
|
||||
switch (byteOrderInfo) {
|
||||
case kCGBitmapByteOrderDefault: {
|
||||
byteOrderNormal = YES;
|
||||
} break;
|
||||
case kCGBitmapByteOrder32Little: {
|
||||
} break;
|
||||
case kCGBitmapByteOrder32Big: {
|
||||
byteOrderNormal = YES;
|
||||
} break;
|
||||
default: break;
|
||||
}
|
||||
// If we can not get bitmap buffer, early return
|
||||
CGDataProviderRef dataProvider = CGImageGetDataProvider(imageRef);
|
||||
if (!dataProvider) {
|
||||
return nil;
|
||||
}
|
||||
CFDataRef dataRef = CGDataProviderCopyData(dataProvider);
|
||||
if (!dataRef) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
uint8_t *rgba = NULL;
|
||||
// We could not assume that input CGImage's color mode is always RGB888/RGBA8888. Convert all other cases to target color mode using vImage
|
||||
if (byteOrderNormal && ((alphaInfo == kCGImageAlphaNone) || (alphaInfo == kCGImageAlphaLast))) {
|
||||
// If the input CGImage is already RGB888/RGBA8888
|
||||
rgba = (uint8_t *)CFDataGetBytePtr(dataRef);
|
||||
} else {
|
||||
// Convert all other cases to target color mode using vImage
|
||||
vImageConverterRef convertor = NULL;
|
||||
vImage_Error error = kvImageNoError;
|
||||
|
||||
vImage_CGImageFormat srcFormat = {
|
||||
.bitsPerComponent = (uint32_t)CGImageGetBitsPerComponent(imageRef),
|
||||
.bitsPerPixel = (uint32_t)CGImageGetBitsPerPixel(imageRef),
|
||||
.colorSpace = CGImageGetColorSpace(imageRef),
|
||||
.bitmapInfo = bitmapInfo
|
||||
};
|
||||
vImage_CGImageFormat destFormat = {
|
||||
.bitsPerComponent = 8,
|
||||
.bitsPerPixel = hasAlpha ? 32 : 24,
|
||||
.colorSpace = [SDImageCoderHelper colorSpaceGetDeviceRGB],
|
||||
.bitmapInfo = hasAlpha ? kCGImageAlphaLast | kCGBitmapByteOrderDefault : kCGImageAlphaNone | kCGBitmapByteOrderDefault // RGB888/RGBA8888 (Non-premultiplied to works for libwebp)
|
||||
};
|
||||
|
||||
convertor = vImageConverter_CreateWithCGImageFormat(&srcFormat, &destFormat, NULL, kvImageNoFlags, &error);
|
||||
if (error != kvImageNoError) {
|
||||
CFRelease(dataRef);
|
||||
return nil;
|
||||
}
|
||||
|
||||
vImage_Buffer src = {
|
||||
.data = (uint8_t *)CFDataGetBytePtr(dataRef),
|
||||
.width = width,
|
||||
.height = height,
|
||||
.rowBytes = bytesPerRow
|
||||
};
|
||||
vImage_Buffer dest;
|
||||
|
||||
error = vImageBuffer_Init(&dest, height, width, destFormat.bitsPerPixel, kvImageNoFlags);
|
||||
if (error != kvImageNoError) {
|
||||
CFRelease(dataRef);
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Convert input color mode to RGB888/RGBA8888
|
||||
error = vImageConvert_AnyToAny(convertor, &src, &dest, NULL, kvImageNoFlags);
|
||||
if (error != kvImageNoError) {
|
||||
CFRelease(dataRef);
|
||||
return nil;
|
||||
}
|
||||
|
||||
rgba = dest.data; // Converted buffer
|
||||
bytesPerRow = dest.rowBytes; // Converted bytePerRow
|
||||
CFRelease(dataRef);
|
||||
dataRef = NULL;
|
||||
}
|
||||
|
||||
uint8_t *data = NULL; // Output WebP data
|
||||
float qualityFactor = quality * 100; // WebP quality is 0-100
|
||||
// Encode RGB888/RGBA8888 buffer to WebP data
|
||||
size_t size;
|
||||
if (hasAlpha) {
|
||||
size = WebPEncodeRGBA(rgba, (int)width, (int)height, (int)bytesPerRow, qualityFactor, &data);
|
||||
} else {
|
||||
size = WebPEncodeRGB(rgba, (int)width, (int)height, (int)bytesPerRow, qualityFactor, &data);
|
||||
}
|
||||
if (dataRef) {
|
||||
CFRelease(dataRef); // free non-converted rgba buffer
|
||||
dataRef = NULL;
|
||||
} else {
|
||||
free(rgba); // free converted rgba buffer
|
||||
rgba = NULL;
|
||||
}
|
||||
|
||||
if (size) {
|
||||
// success
|
||||
webpData = [NSData dataWithBytes:data length:size];
|
||||
}
|
||||
if (data) {
|
||||
WebPFree(data);
|
||||
}
|
||||
|
||||
return webpData;
|
||||
}
|
||||
|
||||
static void FreeImageData(void *info, const void *data, size_t size) {
|
||||
free((void *)data);
|
||||
}
|
||||
|
||||
#pragma mark - SDAnimatedImageCoder
|
||||
- (instancetype)initWithAnimatedImageData:(NSData *)data options:(nullable SDImageCoderOptions *)options {
|
||||
if (!data) {
|
||||
return nil;
|
||||
}
|
||||
if (self) {
|
||||
WebPData webpData;
|
||||
WebPDataInit(&webpData);
|
||||
webpData.bytes = data.bytes;
|
||||
webpData.size = data.length;
|
||||
WebPDemuxer *demuxer = WebPDemux(&webpData);
|
||||
if (!demuxer) {
|
||||
return nil;
|
||||
}
|
||||
BOOL framesValid = [self scanAndCheckFramesValidWithDemuxer:demuxer];
|
||||
if (!framesValid) {
|
||||
WebPDemuxDelete(demuxer);
|
||||
return nil;
|
||||
}
|
||||
CGFloat scale = 1;
|
||||
NSNumber *scaleFactor = options[SDImageCoderDecodeScaleFactor];
|
||||
if (scaleFactor != nil) {
|
||||
scale = [scaleFactor doubleValue];
|
||||
if (scale < 1) {
|
||||
scale = 1;
|
||||
}
|
||||
}
|
||||
_scale = scale;
|
||||
_demux = demuxer;
|
||||
_imageData = data;
|
||||
_currentBlendIndex = NSNotFound;
|
||||
_lock = dispatch_semaphore_create(1);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)scanAndCheckFramesValidWithDemuxer:(WebPDemuxer *)demuxer {
|
||||
if (!demuxer) {
|
||||
return NO;
|
||||
}
|
||||
WebPIterator iter;
|
||||
if (!WebPDemuxGetFrame(demuxer, 1, &iter)) {
|
||||
WebPDemuxReleaseIterator(&iter);
|
||||
return NO;
|
||||
}
|
||||
|
||||
uint32_t iterIndex = 0;
|
||||
uint32_t lastBlendIndex = 0;
|
||||
uint32_t flags = WebPDemuxGetI(demuxer, WEBP_FF_FORMAT_FLAGS);
|
||||
BOOL hasAnimation = flags & ANIMATION_FLAG;
|
||||
BOOL hasAlpha = flags & ALPHA_FLAG;
|
||||
int canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH);
|
||||
int canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT);
|
||||
uint32_t frameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT);
|
||||
uint32_t loopCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT);
|
||||
NSMutableArray<SDWebPCoderFrame *> *frames = [NSMutableArray array];
|
||||
|
||||
// We should loop all the frames and scan each frames' blendFromIndex for later decoding, this can also ensure all frames is valid
|
||||
do {
|
||||
SDWebPCoderFrame *frame = [[SDWebPCoderFrame alloc] init];
|
||||
frame.index = iterIndex;
|
||||
frame.duration = [self sd_frameDurationWithIterator:iter];
|
||||
frame.width = iter.width;
|
||||
frame.height = iter.height;
|
||||
frame.hasAlpha = iter.has_alpha;
|
||||
frame.dispose = iter.dispose_method;
|
||||
frame.blend = iter.blend_method;
|
||||
frame.offsetX = iter.x_offset;
|
||||
frame.offsetY = canvasHeight - iter.y_offset - iter.height;
|
||||
|
||||
BOOL sizeEqualsToCanvas = (iter.width == canvasWidth && iter.height == canvasHeight);
|
||||
BOOL offsetIsZero = (iter.x_offset == 0 && iter.y_offset == 0);
|
||||
frame.isFullSize = (sizeEqualsToCanvas && offsetIsZero);
|
||||
|
||||
if ((!frame.blend || !frame.hasAlpha) && frame.isFullSize) {
|
||||
lastBlendIndex = iterIndex;
|
||||
frame.blendFromIndex = iterIndex;
|
||||
} else {
|
||||
if (frame.dispose && frame.isFullSize) {
|
||||
frame.blendFromIndex = lastBlendIndex;
|
||||
lastBlendIndex = iterIndex + 1;
|
||||
} else {
|
||||
frame.blendFromIndex = lastBlendIndex;
|
||||
}
|
||||
}
|
||||
iterIndex++;
|
||||
[frames addObject:frame];
|
||||
} while (WebPDemuxNextFrame(&iter));
|
||||
WebPDemuxReleaseIterator(&iter);
|
||||
|
||||
if (frames.count != frameCount) {
|
||||
return NO;
|
||||
}
|
||||
_frames = [frames copy];
|
||||
_hasAnimation = hasAnimation;
|
||||
_hasAlpha = hasAlpha;
|
||||
_canvasWidth = canvasWidth;
|
||||
_canvasHeight = canvasHeight;
|
||||
_frameCount = frameCount;
|
||||
_loopCount = loopCount;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSData *)animatedImageData {
|
||||
return _imageData;
|
||||
}
|
||||
|
||||
- (NSUInteger)animatedImageLoopCount {
|
||||
return _loopCount;
|
||||
}
|
||||
|
||||
- (NSUInteger)animatedImageFrameCount {
|
||||
return _frameCount;
|
||||
}
|
||||
|
||||
- (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index {
|
||||
if (index >= _frameCount) {
|
||||
return 0;
|
||||
}
|
||||
return _frames[index].duration;
|
||||
}
|
||||
|
||||
- (UIImage *)animatedImageFrameAtIndex:(NSUInteger)index {
|
||||
UIImage *image;
|
||||
if (index >= _frameCount) {
|
||||
return nil;
|
||||
}
|
||||
LOCKBLOCK({
|
||||
image = [self safeAnimatedImageFrameAtIndex:index];
|
||||
});
|
||||
return image;
|
||||
}
|
||||
|
||||
- (UIImage *)safeAnimatedImageFrameAtIndex:(NSUInteger)index {
|
||||
if (!_canvas) {
|
||||
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Host;
|
||||
bitmapInfo |= _hasAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst;
|
||||
CGContextRef canvas = CGBitmapContextCreate(NULL, _canvasWidth, _canvasHeight, 8, 0, [SDImageCoderHelper colorSpaceGetDeviceRGB], bitmapInfo);
|
||||
if (!canvas) {
|
||||
return nil;
|
||||
}
|
||||
_canvas = canvas;
|
||||
}
|
||||
|
||||
SDWebPCoderFrame *frame = _frames[index];
|
||||
UIImage *image;
|
||||
WebPIterator iter;
|
||||
if (_currentBlendIndex + 1 == index) {
|
||||
// If current blend index is equal to request index, normal serial process
|
||||
_currentBlendIndex = index;
|
||||
// libwebp's index start with 1
|
||||
if (!WebPDemuxGetFrame(_demux, (int)(index + 1), &iter)) {
|
||||
WebPDemuxReleaseIterator(&iter);
|
||||
return nil;
|
||||
}
|
||||
CGImageRef imageRef = [self sd_drawnWebpImageWithCanvas:_canvas iterator:iter];
|
||||
if (!imageRef) {
|
||||
return nil;
|
||||
}
|
||||
#if SD_UIKIT || SD_WATCH
|
||||
image = [[UIImage alloc] initWithCGImage:imageRef scale:_scale orientation:UIImageOrientationUp];
|
||||
#else
|
||||
image = [[UIImage alloc] initWithCGImage:imageRef scale:_scale orientation:kCGImagePropertyOrientationUp];
|
||||
#endif
|
||||
CGImageRelease(imageRef);
|
||||
} else {
|
||||
// Else, this can happen when one image set to different imageViews or one loop end. So we should clear the shared cavans.
|
||||
if (_currentBlendIndex != NSNotFound) {
|
||||
CGContextClearRect(_canvas, CGRectMake(0, 0, _canvasWidth, _canvasHeight));
|
||||
}
|
||||
_currentBlendIndex = index;
|
||||
|
||||
// Then, loop from the blend from index, draw each of previous frames on the canvas.
|
||||
// We use do while loop to call `WebPDemuxNextFrame`(fast), only (startIndex == endIndex) need to create image instance
|
||||
size_t startIndex = frame.blendFromIndex;
|
||||
size_t endIndex = frame.index;
|
||||
if (!WebPDemuxGetFrame(_demux, (int)(startIndex + 1), &iter)) {
|
||||
WebPDemuxReleaseIterator(&iter);
|
||||
return nil;
|
||||
}
|
||||
do {
|
||||
@autoreleasepool {
|
||||
if ((size_t)iter.frame_num == endIndex) {
|
||||
[self sd_blendWebpImageWithCanvas:_canvas iterator:iter];
|
||||
} else {
|
||||
CGImageRef imageRef = [self sd_drawnWebpImageWithCanvas:_canvas iterator:iter];
|
||||
if (!imageRef) {
|
||||
return nil;
|
||||
}
|
||||
#if SD_UIKIT || SD_WATCH
|
||||
image = [[UIImage alloc] initWithCGImage:imageRef scale:_scale orientation:UIImageOrientationUp];
|
||||
#else
|
||||
image = [[UIImage alloc] initWithCGImage:imageRef scale:_scale orientation:kCGImagePropertyOrientationUp];
|
||||
#endif
|
||||
CGImageRelease(imageRef);
|
||||
}
|
||||
}
|
||||
} while ((size_t)iter.frame_num < (endIndex + 1) && WebPDemuxNextFrame(&iter));
|
||||
}
|
||||
|
||||
WebPDemuxReleaseIterator(&iter);
|
||||
return image;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* This file is part of the SDWebImage package.
|
||||
* (c) Olivier Poitrey <rs@dailymotion.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
#ifdef SD_WEBP
|
||||
|
||||
#import "SDWebImageCompat.h"
|
||||
|
||||
// This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directlly use `SDImageCoder`
|
||||
@interface UIImage (WebP)
|
||||
|
||||
/**
|
||||
Create a image from the WebP data.
|
||||
This will create animated image if the data is Animated WebP. And will create a static image is the data is Static WebP.
|
||||
|
||||
@param data The WebP data
|
||||
@return The created image
|
||||
*/
|
||||
+ (nullable UIImage *)sd_imageWithWebPData:(nullable NSData *)data;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* This file is part of the SDWebImage package.
|
||||
* (c) Olivier Poitrey <rs@dailymotion.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
#ifdef SD_WEBP
|
||||
|
||||
#import "UIImage+WebP.h"
|
||||
#import "SDImageWebPCoder.h"
|
||||
|
||||
@implementation UIImage (WebP)
|
||||
|
||||
+ (nullable UIImage *)sd_imageWithWebPData:(nullable NSData *)data {
|
||||
if (!data) {
|
||||
return nil;
|
||||
}
|
||||
return [[SDImageWebPCoder sharedCoder] decodedImageWithData:data options:0];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -9,7 +9,6 @@ target 'Tests' do
|
|||
platform :ios, '8.0'
|
||||
pod 'Expecta'
|
||||
pod 'KVOController'
|
||||
pod 'SDWebImage/WebP', :path => '../'
|
||||
pod 'SDWebImage/MapKit', :path => '../'
|
||||
|
||||
end
|
||||
|
@ -18,7 +17,6 @@ target 'Tests Mac' do
|
|||
platform :osx, '10.10'
|
||||
pod 'Expecta'
|
||||
pod 'KVOController'
|
||||
pod 'SDWebImage/WebP', :path => '../'
|
||||
pod 'SDWebImage/MapKit', :path => '../'
|
||||
|
||||
end
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
1E3C51E919B46E370092B5E6 /* SDWebImageDownloaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E3C51E819B46E370092B5E6 /* SDWebImageDownloaderTests.m */; };
|
||||
2D7AF0601F329763000083C2 /* SDTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D7AF05F1F329763000083C2 /* SDTestCase.m */; };
|
||||
320630412085A37C006E0FA4 /* SDAnimatedImageTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A571552037DB2D002EDAAE /* SDAnimatedImageTest.m */; };
|
||||
321259EC1F39E3240096FE0E /* TestImageStatic.webp in Resources */ = {isa = PBXBuildFile; fileRef = 321259EB1F39E3240096FE0E /* TestImageStatic.webp */; };
|
||||
321259EE1F39E4110096FE0E /* TestImageAnimated.webp in Resources */ = {isa = PBXBuildFile; fileRef = 321259ED1F39E4110096FE0E /* TestImageAnimated.webp */; };
|
||||
3226ECBB20754F7700FAFACF /* SDWebImageTestDownloadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3226ECBA20754F7700FAFACF /* SDWebImageTestDownloadOperation.m */; };
|
||||
3226ECBC20754F7700FAFACF /* SDWebImageTestDownloadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3226ECBA20754F7700FAFACF /* SDWebImageTestDownloadOperation.m */; };
|
||||
323B8E1F20862322008952BE /* SDWebImageTestLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 323B8E1E20862322008952BE /* SDWebImageTestLoader.m */; };
|
||||
|
@ -40,8 +38,6 @@
|
|||
32B99EA4203B31360017FD66 /* TestImage.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 5F7F38AC1AE2A77A00B0E330 /* TestImage.jpg */; };
|
||||
32B99EA5203B31360017FD66 /* TestImageLarge.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 43828A441DA67F9900000E62 /* TestImageLarge.jpg */; };
|
||||
32B99EA6203B31360017FD66 /* TestImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 433BBBB81D7EF8260086B6E9 /* TestImage.png */; };
|
||||
32B99EA7203B31360017FD66 /* TestImageAnimated.webp in Resources */ = {isa = PBXBuildFile; fileRef = 321259ED1F39E4110096FE0E /* TestImageAnimated.webp */; };
|
||||
32B99EA8203B31360017FD66 /* TestImageStatic.webp in Resources */ = {isa = PBXBuildFile; fileRef = 321259EB1F39E3240096FE0E /* TestImageStatic.webp */; };
|
||||
32B99EA9203B34B60017FD66 /* SDImageCoderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 433BBBB41D7EF5C00086B6E9 /* SDImageCoderTests.m */; };
|
||||
32B99EAA203B365F0017FD66 /* SDImageCacheTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA248D68195475D800390AB0 /* SDImageCacheTests.m */; };
|
||||
32B99EAB203B36620017FD66 /* SDWebImageManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA248D6A195476AC00390AB0 /* SDWebImageManagerTests.m */; };
|
||||
|
@ -72,8 +68,6 @@
|
|||
1E3C51E819B46E370092B5E6 /* SDWebImageDownloaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDWebImageDownloaderTests.m; sourceTree = "<group>"; };
|
||||
2D7AF05E1F329763000083C2 /* SDTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDTestCase.h; sourceTree = "<group>"; };
|
||||
2D7AF05F1F329763000083C2 /* SDTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDTestCase.m; sourceTree = "<group>"; };
|
||||
321259EB1F39E3240096FE0E /* TestImageStatic.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = TestImageStatic.webp; sourceTree = "<group>"; };
|
||||
321259ED1F39E4110096FE0E /* TestImageAnimated.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = TestImageAnimated.webp; sourceTree = "<group>"; };
|
||||
3226ECB920754F7700FAFACF /* SDWebImageTestDownloadOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDWebImageTestDownloadOperation.h; sourceTree = "<group>"; };
|
||||
3226ECBA20754F7700FAFACF /* SDWebImageTestDownloadOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDWebImageTestDownloadOperation.m; sourceTree = "<group>"; };
|
||||
323B8E1D20862322008952BE /* SDWebImageTestLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDWebImageTestLoader.h; sourceTree = "<group>"; };
|
||||
|
@ -159,8 +153,6 @@
|
|||
433BBBB81D7EF8260086B6E9 /* TestImage.png */,
|
||||
327A418B211D660600495442 /* TestImage.heic */,
|
||||
32905E63211D786E00460FCF /* TestImage.heif */,
|
||||
321259ED1F39E4110096FE0E /* TestImageAnimated.webp */,
|
||||
321259EB1F39E3240096FE0E /* TestImageStatic.webp */,
|
||||
327054E1206CEFF3006EA328 /* TestImageAnimated.apng */,
|
||||
);
|
||||
path = Images;
|
||||
|
@ -298,7 +290,7 @@
|
|||
DA248D461954721A00390AB0 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0900;
|
||||
LastUpgradeCheck = 0940;
|
||||
TargetAttributes = {
|
||||
32B99E91203B2DF90017FD66 = {
|
||||
CreatedOnToolsVersion = 9.2;
|
||||
|
@ -336,8 +328,6 @@
|
|||
32B99EA2203B31360017FD66 /* MonochromeTestImage.jpg in Resources */,
|
||||
32905E65211D786E00460FCF /* TestImage.heif in Resources */,
|
||||
327A418D211D660600495442 /* TestImage.heic in Resources */,
|
||||
32B99EA8203B31360017FD66 /* TestImageStatic.webp in Resources */,
|
||||
32B99EA7203B31360017FD66 /* TestImageAnimated.webp in Resources */,
|
||||
32B99EA5203B31360017FD66 /* TestImageLarge.jpg in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -347,12 +337,10 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
327A418C211D660600495442 /* TestImage.heic in Resources */,
|
||||
321259EE1F39E4110096FE0E /* TestImageAnimated.webp in Resources */,
|
||||
5F7F38AD1AE2A77A00B0E330 /* TestImage.jpg in Resources */,
|
||||
32905E64211D786E00460FCF /* TestImage.heif in Resources */,
|
||||
43828A451DA67F9900000E62 /* TestImageLarge.jpg in Resources */,
|
||||
433BBBB71D7EF8200086B6E9 /* TestImage.gif in Resources */,
|
||||
321259EC1F39E3240096FE0E /* TestImageStatic.webp in Resources */,
|
||||
DA248D61195472AA00390AB0 /* InfoPlist.strings in Resources */,
|
||||
433BBBB91D7EF8260086B6E9 /* TestImage.png in Resources */,
|
||||
327054E2206CEFF3006EA328 /* TestImageAnimated.apng in Resources */,
|
||||
|
@ -373,14 +361,12 @@
|
|||
"${BUILT_PRODUCTS_DIR}/Expecta-macOS/Expecta.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/KVOController-macOS/KVOController.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImage-macOS/SDWebImage.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/libwebp-macOS/libwebp.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Expecta.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KVOController.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
|
@ -433,14 +419,12 @@
|
|||
"${BUILT_PRODUCTS_DIR}/Expecta-iOS/Expecta.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/KVOController-iOS/KVOController.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/SDWebImage-iOS/SDWebImage.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/libwebp-iOS/libwebp.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Expecta.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KVOController.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
|
@ -595,11 +579,13 @@
|
|||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
|
@ -629,11 +615,13 @@
|
|||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,9 +26,8 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
codeCoverageEnabled = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
|
@ -57,7 +56,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "0940"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,9 +26,8 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
codeCoverageEnabled = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
|
@ -48,7 +47,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 30 KiB |
|
@ -29,7 +29,6 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
|
||||
- (void)tearDown {
|
||||
[[SDImageCache sharedImageCache] removeImageForKey:kTestGIFURL fromDisk:YES withCompletion:nil];
|
||||
[[SDImageCache sharedImageCache] removeImageForKey:kTestWebPURL fromDisk:YES withCompletion:nil];
|
||||
}
|
||||
|
||||
- (void)test01AnimatedImageInitWithData {
|
||||
|
@ -97,14 +96,6 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
expect(imageView.currentFrame).beNil(); // current frame
|
||||
}
|
||||
|
||||
- (void)test07AnimatedImageViewSetAnimatedImageWEBP {
|
||||
SDAnimatedImageView *imageView = [SDAnimatedImageView new];
|
||||
SDAnimatedImage *image = [SDAnimatedImage imageWithData:[self testAnimatedWebPData]];
|
||||
imageView.image = image;
|
||||
expect(imageView.image).notTo.beNil();
|
||||
expect(imageView.currentFrame).notTo.beNil(); // current frame
|
||||
}
|
||||
|
||||
- (void)test08AnimatedImageViewSetAnimatedImageGIF {
|
||||
SDAnimatedImageView *imageView = [SDAnimatedImageView new];
|
||||
SDAnimatedImage *image = [SDAnimatedImage imageWithData:[self testGIFData]];
|
||||
|
@ -210,7 +201,7 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
- (void)test22AnimatedImageViewCategory {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView view category"];
|
||||
SDAnimatedImageView *imageView = [SDAnimatedImageView new];
|
||||
NSURL *testURL = [NSURL URLWithString:kTestWebPURL];
|
||||
NSURL *testURL = [NSURL URLWithString:kTestGIFURL];
|
||||
[imageView sd_setImageWithURL:testURL completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
|
||||
expect(error).to.beNil();
|
||||
expect(image).notTo.beNil();
|
||||
|
@ -268,16 +259,6 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
return testData;
|
||||
}
|
||||
|
||||
- (NSString *)testAnimatedWebPPath {
|
||||
NSBundle *testBundle = [NSBundle bundleForClass:[self class]];
|
||||
NSString *testPath = [testBundle pathForResource:@"TestImageAnimated" ofType:@"webp"];
|
||||
return testPath;
|
||||
}
|
||||
|
||||
- (NSData *)testAnimatedWebPData {
|
||||
return [NSData dataWithContentsOfFile:[self testAnimatedWebPPath]];
|
||||
}
|
||||
|
||||
- (NSString *)testAPNGPPath {
|
||||
NSBundle *testBundle = [NSBundle bundleForClass:[self class]];
|
||||
NSString *testPath = [testBundle pathForResource:@"TestImageAnimated" ofType:@"apng"];
|
||||
|
|
|
@ -51,16 +51,6 @@
|
|||
expect(image).notTo.beNil();
|
||||
}
|
||||
|
||||
- (void)test04UIImageWebPCategory {
|
||||
// Test invalid image data
|
||||
UIImage *image = [UIImage sd_imageWithWebPData:nil];
|
||||
expect(image).to.beNil();
|
||||
// Test valid image data
|
||||
NSData *data = [NSData dataWithContentsOfFile:[self testWebPPath]];
|
||||
image = [UIImage sd_imageWithWebPData:data];
|
||||
expect(image).notTo.beNil();
|
||||
}
|
||||
|
||||
#pragma mark - Helper
|
||||
|
||||
- (NSString *)testJPEGPath {
|
||||
|
@ -73,9 +63,4 @@
|
|||
return [testBundle pathForResource:@"TestImage" ofType:@"gif"];
|
||||
}
|
||||
|
||||
- (NSString *)testWebPPath {
|
||||
NSBundle *testBundle = [NSBundle bundleForClass:[self class]];
|
||||
return [testBundle pathForResource:@"TestImageStatic" ofType:@"webp"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -79,26 +79,10 @@
|
|||
}
|
||||
#endif
|
||||
|
||||
- (void)test09ThatStaticWebPCoderWorks {
|
||||
NSURL *staticWebPURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"TestImageStatic" withExtension:@"webp"];
|
||||
[self verifyCoder:[SDImageWebPCoder sharedCoder]
|
||||
withLocalImageURL:staticWebPURL
|
||||
supportsEncoding:YES
|
||||
isAnimatedImage:NO];
|
||||
}
|
||||
|
||||
- (void)test10ThatAnimatedWebPCoderWorks {
|
||||
NSURL *animatedWebPURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"TestImageAnimated" withExtension:@"webp"];
|
||||
[self verifyCoder:[SDImageWebPCoder sharedCoder]
|
||||
withLocalImageURL:animatedWebPURL
|
||||
supportsEncoding:YES
|
||||
isAnimatedImage:YES];
|
||||
}
|
||||
|
||||
- (void)test11ThatAPNGPCoderWorks {
|
||||
NSURL *animatedWebPURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"TestImageAnimated" withExtension:@"apng"];
|
||||
NSURL *APNGURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"TestImageAnimated" withExtension:@"apng"];
|
||||
[self verifyCoder:[SDImageAPNGCoder sharedCoder]
|
||||
withLocalImageURL:animatedWebPURL
|
||||
withLocalImageURL:APNGURL
|
||||
supportsEncoding:YES
|
||||
isAnimatedImage:YES];
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ FOUNDATION_EXPORT NSString * _Nonnull const kTestJPEGURL;
|
|||
FOUNDATION_EXPORT NSString * _Nonnull const kTestProgressiveJPEGURL;
|
||||
FOUNDATION_EXPORT NSString * _Nonnull const kTestPNGURL;
|
||||
FOUNDATION_EXPORT NSString * _Nonnull const kTestGIFURL;
|
||||
FOUNDATION_EXPORT NSString * _Nonnull const kTestWebPURL;
|
||||
FOUNDATION_EXPORT NSString * _Nonnull const kTestAPNGPURL;
|
||||
|
||||
@interface SDTestCase : XCTestCase
|
||||
|
|
|
@ -15,7 +15,6 @@ NSString *const kTestJPEGURL = @"http://via.placeholder.com/50x50.jpg";
|
|||
NSString *const kTestProgressiveJPEGURL = @"https://raw.githubusercontent.com/ibireme/YYImage/master/Demo/YYImageDemo/mew_progressive.jpg";
|
||||
NSString *const kTestPNGURL = @"http://via.placeholder.com/50x50.png";
|
||||
NSString *const kTestGIFURL = @"https://media.giphy.com/media/UEsrLdv7ugRTq/giphy.gif";
|
||||
NSString *const kTestWebPURL = @"http://littlesvr.ca/apng/images/SteamEngine.webp";
|
||||
NSString *const kTestAPNGPURL = @"https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png";
|
||||
|
||||
@implementation SDTestCase
|
||||
|
|
|
@ -231,34 +231,6 @@
|
|||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)test15ThatWEBPWorks {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"WEBP"];
|
||||
NSURL *imageURL = [NSURL URLWithString:@"http://www.ioncannon.net/wp-content/uploads/2011/06/test2.webp"];
|
||||
[[SDWebImageDownloader sharedDownloader] downloadImageWithURL:imageURL options:0 progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
|
||||
if (image && data && !error && finished) {
|
||||
[expectation fulfill];
|
||||
} else {
|
||||
XCTFail(@"Something went wrong");
|
||||
}
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)test16ThatProgressiveWebPWorks {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Progressive WebP download"];
|
||||
NSURL *imageURL = [NSURL URLWithString:@"http://www.ioncannon.net/wp-content/uploads/2011/06/test9.webp"];
|
||||
[[SDWebImageDownloader sharedDownloader] downloadImageWithURL:imageURL options:SDWebImageDownloaderProgressiveLoad progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
|
||||
if (image && data && !error && finished) {
|
||||
[expectation fulfill];
|
||||
} else if (finished) {
|
||||
XCTFail(@"Something went wrong");
|
||||
} else {
|
||||
// progressive updates
|
||||
}
|
||||
}];
|
||||
[self waitForExpectationsWithCommonTimeout];
|
||||
}
|
||||
|
||||
- (void)test17ThatMinimumProgressIntervalWorks {
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:@"Minimum progress interval"];
|
||||
SDWebImageDownloaderConfig *config = SDWebImageDownloaderConfig.defaultDownloaderConfig;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 50d1a848bc56554af8413cfe681f94286a6371b3
|
|
@ -80,9 +80,3 @@ FOUNDATION_EXPORT const unsigned char WebImageVersionString[];
|
|||
#if __has_include(<SDWebImage/MKAnnotationView+WebCache.h>)
|
||||
#import <SDWebImage/MKAnnotationView+WebCache.h>
|
||||
#endif
|
||||
|
||||
// WebP
|
||||
#if __has_include(<SDWebImage/UIImage+WebP.h>)
|
||||
#import <SDWebImage/UIImage+WebP.h>
|
||||
#import <SDWebImage/SDImageWebPCoder.h>
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue