diff --git a/Dependencies/SDWebImage-master/.github/stale.yml b/Dependencies/SDWebImage-master/.github/stale.yml new file mode 100644 index 00000000..3b3b587f --- /dev/null +++ b/Dependencies/SDWebImage-master/.github/stale.yml @@ -0,0 +1,28 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 30 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - important +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + If this is still an issue, please make sure it is up to date and if so, + add a comment that this is still an issue to keep it open. + Thank you for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false + +# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': +pulls: + daysUntilStale: 60 + markComment: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. + If this is still applicable, please make sure it is up to date and if so, + add a comment that this is still an issue to keep it open. + Thank you for your contributions. diff --git a/Dependencies/SDWebImage-master/SDWebImage/UIImage+MemoryCacheCost.h b/Dependencies/SDWebImage-master/SDWebImage/UIImage+MemoryCacheCost.h new file mode 100644 index 00000000..9ecf5b94 --- /dev/null +++ b/Dependencies/SDWebImage-master/SDWebImage/UIImage+MemoryCacheCost.h @@ -0,0 +1,23 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +@interface UIImage (MemoryCacheCost) + +/** + The memory cache cost for specify image used by image cache. The cost function is the pixles count held in memory. + If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost. + + For `UIImage`, this method return the single frame pixles count when `image.images` is nil for static image. Retuen full frame pixels count when `image.images` is not nil for animated image. + For `NSImage`, this method return the single frame pixels count because `NSImage` does not store all frames in memory. + @note Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. + */ +@property (assign, nonatomic) NSUInteger sd_memoryCost; + +@end diff --git a/Dependencies/SDWebImage-master/SDWebImage/UIImage+MemoryCacheCost.m b/Dependencies/SDWebImage-master/SDWebImage/UIImage+MemoryCacheCost.m new file mode 100644 index 00000000..6f1375d7 --- /dev/null +++ b/Dependencies/SDWebImage-master/SDWebImage/UIImage+MemoryCacheCost.m @@ -0,0 +1,38 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "UIImage+MemoryCacheCost.h" +#import "objc/runtime.h" + +FOUNDATION_STATIC_INLINE NSUInteger SDMemoryCacheCostForImage(UIImage *image) { +#if SD_MAC + return image.size.height * image.size.width; +#elif SD_UIKIT || SD_WATCH + NSUInteger imageSize = image.size.height * image.size.width * image.scale * image.scale; + return image.images ? (imageSize * image.images.count) : imageSize; +#endif +} + +@implementation UIImage (MemoryCacheCost) + +- (NSUInteger)sd_memoryCost { + NSNumber *value = objc_getAssociatedObject(self, @selector(sd_memoryCost)); + NSUInteger memoryCost; + if (value != nil) { + memoryCost = [value unsignedIntegerValue]; + } else { + memoryCost = SDMemoryCacheCostForImage(self); + } + return memoryCost; +} + +- (void)setSd_memoryCost:(NSUInteger)sd_memoryCost { + objc_setAssociatedObject(self, @selector(sd_memoryCost), @(sd_memoryCost), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end diff --git a/Dependencies/SDWebImage-master/WebImage/Info.plist b/Dependencies/SDWebImage-master/WebImage/Info.plist index d0da3995..b511558c 100644 --- a/Dependencies/SDWebImage-master/WebImage/Info.plist +++ b/Dependencies/SDWebImage-master/WebImage/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.4.2 + 4.4.3 CFBundleSignature ???? CFBundleVersion - 4.4.2 + 4.4.3 NSPrincipalClass diff --git a/Dependencies/SDWebImage-master/WebImage/SDWebImage.h b/Dependencies/SDWebImage-master/WebImage/SDWebImage.h index 07c173e3..d1766cf7 100644 --- a/Dependencies/SDWebImage-master/WebImage/SDWebImage.h +++ b/Dependencies/SDWebImage-master/WebImage/SDWebImage.h @@ -32,6 +32,7 @@ FOUNDATION_EXPORT const unsigned char WebImageVersionString[]; #import #import #import +#import #import #import #import diff --git a/Shukofukurou-IOS.xcodeproj/project.pbxproj b/Shukofukurou-IOS.xcodeproj/project.pbxproj index 78572e33..8a27b200 100644 --- a/Shukofukurou-IOS.xcodeproj/project.pbxproj +++ b/Shukofukurou-IOS.xcodeproj/project.pbxproj @@ -78,8 +78,6 @@ 5962422721556514001995AD /* SearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5962420D21556510001995AD /* SearchViewController.m */; }; 5962422821556514001995AD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5962421021556512001995AD /* ViewController.m */; }; 5962422C2155653D001995AD /* Hiyoko.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 5962422A2155653D001995AD /* Hiyoko.xcdatamodeld */; }; - 59624230215565C7001995AD /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 596240F721556317001995AD /* SDWebImage.framework */; }; - 59624231215565C7001995AD /* SDWebImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 596240F721556317001995AD /* SDWebImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 59624235215565CC001995AD /* SAMKeychain.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 596241092155631F001995AD /* SAMKeychain.framework */; }; 59624236215565CC001995AD /* SAMKeychain.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 596241092155631F001995AD /* SAMKeychain.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 59624239215565D2001995AD /* CoreActionSheetPicker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5962411C21556329001995AD /* CoreActionSheetPicker.framework */; }; @@ -119,6 +117,8 @@ 59A75818215D3A8800B36F9C /* TitleInfoCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A75817215D3A8800B36F9C /* TitleInfoCache.m */; }; 59AEEA082156CFBD005D99D5 /* ThirdParty.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 59AEEA072156CFBD005D99D5 /* ThirdParty.rtf */; }; 59AEEA0B2156D2CB005D99D5 /* ThirdPartyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59AEEA0A2156D2CB005D99D5 /* ThirdPartyViewController.m */; }; + 59B22D2921FE630000627172 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59B22D2221FE62F400627172 /* SDWebImage.framework */; }; + 59B22D2A21FE630000627172 /* SDWebImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 59B22D2221FE62F400627172 /* SDWebImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 59D9159F2162C1B800B5A61B /* UILabel+Copyable.m in Sources */ = {isa = PBXBuildFile; fileRef = 59D9159D2162C1B800B5A61B /* UILabel+Copyable.m */; }; 59EBC1EE21FD2FCA00481D33 /* ThemeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EBC1ED21FD2FCA00481D33 /* ThemeManager.m */; }; 59EBC1F121FD2FFB00481D33 /* ThemeManagerTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 59EBC1F021FD2FFB00481D33 /* ThemeManagerTheme.m */; }; @@ -138,48 +138,6 @@ remoteGlobalIDString = 596240A42155622E001995AD; remoteInfo = "Shukofukurou-IOS"; }; - 596240F221556317001995AD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 596240E921556317001995AD /* SDWebImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 53761325155AD0D5005750A4; - remoteInfo = "SDWebImage iOS static"; - }; - 596240F421556317001995AD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 596240E921556317001995AD /* SDWebImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4314D1991D0E0E3B004B36C9; - remoteInfo = "SDWebImage watchOS static"; - }; - 596240F621556317001995AD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 596240E921556317001995AD /* SDWebImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4A2CADFF1AB4BB5300B6BC39; - remoteInfo = "SDWebImage iOS"; - }; - 596240F821556317001995AD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 596240E921556317001995AD /* SDWebImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 00733A4C1BC487C000A5A117; - remoteInfo = "SDWebImage tvOS"; - }; - 596240FA21556317001995AD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 596240E921556317001995AD /* SDWebImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 431BB7031D06D2C1006A3455; - remoteInfo = "SDWebImage watchOS"; - }; - 596240FC21556317001995AD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 596240E921556317001995AD /* SDWebImage.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4397D2F21D0DDD8C00BB2784; - remoteInfo = "SDWebImage OSX"; - }; 596241082155631F001995AD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 596240FE2155631F001995AD /* SAMKeychain.xcodeproj */; @@ -306,13 +264,6 @@ remoteGlobalIDString = C63EE56B1BBA07ED008F46BB; remoteInfo = MGSwipeTableCell; }; - 59624232215565C7001995AD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 596240E921556317001995AD /* SDWebImage.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 4A2CADFE1AB4BB5300B6BC39; - remoteInfo = "SDWebImage iOS"; - }; 59624237215565CC001995AD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 596240FE2155631F001995AD /* SAMKeychain.xcodeproj */; @@ -362,12 +313,54 @@ remoteGlobalIDString = 4CD5970C1D1C5EBE00AB28D3; remoteInfo = IQKeyboardManagerSwift; }; - 597BD4AA21FD5D15001393B9 /* PBXContainerItemProxy */ = { + 59B22D1D21FE62F400627172 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 597BD49F21FD5D07001393B9 /* IQKeyboardManager.xcodeproj */; + containerPortal = 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 53761325155AD0D5005750A4; + remoteInfo = "SDWebImage iOS static"; + }; + 59B22D1F21FE62F400627172 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4314D1991D0E0E3B004B36C9; + remoteInfo = "SDWebImage watchOS static"; + }; + 59B22D2121FE62F400627172 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4A2CADFF1AB4BB5300B6BC39; + remoteInfo = "SDWebImage iOS"; + }; + 59B22D2321FE62F400627172 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 00733A4C1BC487C000A5A117; + remoteInfo = "SDWebImage tvOS"; + }; + 59B22D2521FE62F400627172 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 431BB7031D06D2C1006A3455; + remoteInfo = "SDWebImage watchOS"; + }; + 59B22D2721FE62F400627172 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4397D2F21D0DDD8C00BB2784; + remoteInfo = "SDWebImage OSX"; + }; + 59B22D2B21FE630000627172 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */; proxyType = 1; - remoteGlobalIDString = 4CD2C4A51C5A615600975A7A; - remoteInfo = IQKeyboardManager; + remoteGlobalIDString = 4A2CADFE1AB4BB5300B6BC39; + remoteInfo = "SDWebImage iOS"; }; /* End PBXContainerItemProxy section */ @@ -382,9 +375,9 @@ 5962423A215565D2001995AD /* CoreActionSheetPicker.framework in Embed Frameworks */, 5962423E215565D7001995AD /* AFNetworking.framework in Embed Frameworks */, 59624236215565CC001995AD /* SAMKeychain.framework in Embed Frameworks */, + 59B22D2A21FE630000627172 /* SDWebImage.framework in Embed Frameworks */, 59624246215565E3001995AD /* LGSideMenuController.framework in Embed Frameworks */, 597BD4A921FD5D15001393B9 /* IQKeyboardManager.framework in Embed Frameworks */, - 59624231215565C7001995AD /* SDWebImage.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -428,7 +421,6 @@ 596240C02155622F001995AD /* Shukofukurou-IOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Shukofukurou-IOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 596240C42155622F001995AD /* Shukofukurou_IOSTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Shukofukurou_IOSTests.m; sourceTree = ""; }; 596240C62155622F001995AD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 596240E921556317001995AD /* SDWebImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = SDWebImage.xcodeproj; sourceTree = ""; }; 596240FE2155631F001995AD /* SAMKeychain.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = SAMKeychain.xcodeproj; sourceTree = ""; }; 5962411621556329001995AD /* CoreActionSheetPicker.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CoreActionSheetPicker.xcodeproj; path = CoreActionSheetPicker/CoreActionSheetPicker.xcodeproj; sourceTree = ""; }; 5962411F21556336001995AD /* AFNetworking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = AFNetworking.xcodeproj; sourceTree = ""; }; @@ -587,6 +579,7 @@ 59AEEA072156CFBD005D99D5 /* ThirdParty.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = ThirdParty.rtf; sourceTree = ""; }; 59AEEA092156D2CB005D99D5 /* ThirdPartyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ThirdPartyViewController.h; sourceTree = ""; }; 59AEEA0A2156D2CB005D99D5 /* ThirdPartyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ThirdPartyViewController.m; sourceTree = ""; }; + 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = SDWebImage.xcodeproj; sourceTree = ""; }; 59D9159D2162C1B800B5A61B /* UILabel+Copyable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+Copyable.m"; sourceTree = ""; }; 59D9159E2162C1B800B5A61B /* UILabel+Copyable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+Copyable.h"; sourceTree = ""; }; 59EBC1EC21FD2FCA00481D33 /* ThemeManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ThemeManager.h; sourceTree = ""; }; @@ -616,9 +609,9 @@ 59624239215565D2001995AD /* CoreActionSheetPicker.framework in Frameworks */, 5962423D215565D7001995AD /* AFNetworking.framework in Frameworks */, 59624235215565CC001995AD /* SAMKeychain.framework in Frameworks */, + 59B22D2921FE630000627172 /* SDWebImage.framework in Frameworks */, 59624245215565E3001995AD /* LGSideMenuController.framework in Frameworks */, 597BD4A821FD5D15001393B9 /* IQKeyboardManager.framework in Frameworks */, - 59624230215565C7001995AD /* SDWebImage.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -763,24 +756,11 @@ 596240E1215562D2001995AD /* SDWebImage-master */ = { isa = PBXGroup; children = ( - 596240E921556317001995AD /* SDWebImage.xcodeproj */, + 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */, ); path = "SDWebImage-master"; sourceTree = ""; }; - 596240EA21556317001995AD /* Products */ = { - isa = PBXGroup; - children = ( - 596240F321556317001995AD /* libSDWebImage iOS static.a */, - 596240F521556317001995AD /* libSDWebImage watchOS static.a */, - 596240F721556317001995AD /* SDWebImage.framework */, - 596240F921556317001995AD /* SDWebImage.framework */, - 596240FB21556317001995AD /* SDWebImage.framework */, - 596240FD21556317001995AD /* SDWebImage.framework */, - ); - name = Products; - sourceTree = ""; - }; 596240FF2155631F001995AD /* Products */ = { isa = PBXGroup; children = ( @@ -1094,6 +1074,19 @@ path = TopAlignedLabel; sourceTree = ""; }; + 59B22D1521FE62F300627172 /* Products */ = { + isa = PBXGroup; + children = ( + 59B22D1E21FE62F400627172 /* libSDWebImage iOS static.a */, + 59B22D2021FE62F400627172 /* libSDWebImage watchOS static.a */, + 59B22D2221FE62F400627172 /* SDWebImage.framework */, + 59B22D2421FE62F400627172 /* SDWebImage.framework */, + 59B22D2621FE62F400627172 /* SDWebImage.framework */, + 59B22D2821FE62F400627172 /* SDWebImage.framework */, + ); + name = Products; + sourceTree = ""; + }; 59D915882162C1A600B5A61B /* UILabel+Copyable */ = { isa = PBXGroup; children = ( @@ -1133,13 +1126,12 @@ buildRules = ( ); dependencies = ( - 59624233215565C7001995AD /* PBXTargetDependency */, 59624238215565CC001995AD /* PBXTargetDependency */, 5962423C215565D2001995AD /* PBXTargetDependency */, 59624240215565D7001995AD /* PBXTargetDependency */, 59624248215565E3001995AD /* PBXTargetDependency */, 5962424C215565E9001995AD /* PBXTargetDependency */, - 597BD4AB21FD5D15001393B9 /* PBXTargetDependency */, + 59B22D2C21FE630000627172 /* PBXTargetDependency */, ); name = "Shukofukurou-IOS"; productName = "Shukofukurou-IOS"; @@ -1227,8 +1219,8 @@ ProjectRef = 596240FE2155631F001995AD /* SAMKeychain.xcodeproj */; }, { - ProductGroup = 596240EA21556317001995AD /* Products */; - ProjectRef = 596240E921556317001995AD /* SDWebImage.xcodeproj */; + ProductGroup = 59B22D1521FE62F300627172 /* Products */; + ProjectRef = 59B22D1421FE62F300627172 /* SDWebImage.xcodeproj */; }, ); projectRoot = ""; @@ -1240,48 +1232,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 596240F321556317001995AD /* libSDWebImage iOS static.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libSDWebImage iOS static.a"; - remoteRef = 596240F221556317001995AD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 596240F521556317001995AD /* libSDWebImage watchOS static.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libSDWebImage watchOS static.a"; - remoteRef = 596240F421556317001995AD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 596240F721556317001995AD /* SDWebImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SDWebImage.framework; - remoteRef = 596240F621556317001995AD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 596240F921556317001995AD /* SDWebImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SDWebImage.framework; - remoteRef = 596240F821556317001995AD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 596240FB21556317001995AD /* SDWebImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SDWebImage.framework; - remoteRef = 596240FA21556317001995AD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 596240FD21556317001995AD /* SDWebImage.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SDWebImage.framework; - remoteRef = 596240FC21556317001995AD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 596241092155631F001995AD /* SAMKeychain.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; @@ -1422,6 +1372,48 @@ remoteRef = 597BD4A621FD5D07001393B9 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 59B22D1E21FE62F400627172 /* libSDWebImage iOS static.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libSDWebImage iOS static.a"; + remoteRef = 59B22D1D21FE62F400627172 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 59B22D2021FE62F400627172 /* libSDWebImage watchOS static.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libSDWebImage watchOS static.a"; + remoteRef = 59B22D1F21FE62F400627172 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 59B22D2221FE62F400627172 /* SDWebImage.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SDWebImage.framework; + remoteRef = 59B22D2121FE62F400627172 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 59B22D2421FE62F400627172 /* SDWebImage.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SDWebImage.framework; + remoteRef = 59B22D2321FE62F400627172 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 59B22D2621FE62F400627172 /* SDWebImage.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SDWebImage.framework; + remoteRef = 59B22D2521FE62F400627172 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 59B22D2821FE62F400627172 /* SDWebImage.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = SDWebImage.framework; + remoteRef = 59B22D2721FE62F400627172 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -1571,11 +1563,6 @@ target = 596240A42155622E001995AD /* Shukofukurou-IOS */; targetProxy = 596240C12155622F001995AD /* PBXContainerItemProxy */; }; - 59624233215565C7001995AD /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "SDWebImage iOS"; - targetProxy = 59624232215565C7001995AD /* PBXContainerItemProxy */; - }; 59624238215565CC001995AD /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "SAMKeychain-iOS"; @@ -1601,10 +1588,10 @@ name = MGSwipeTableCell; targetProxy = 5962424B215565E9001995AD /* PBXContainerItemProxy */; }; - 597BD4AB21FD5D15001393B9 /* PBXTargetDependency */ = { + 59B22D2C21FE630000627172 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = IQKeyboardManager; - targetProxy = 597BD4AA21FD5D15001393B9 /* PBXContainerItemProxy */; + name = "SDWebImage iOS"; + targetProxy = 59B22D2B21FE630000627172 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ diff --git a/Shukofukurou-IOS/Backend/AniList.m b/Shukofukurou-IOS/Backend/AniList.m index 16bbec88..f9566bb5 100644 --- a/Shukofukurou-IOS/Backend/AniList.m +++ b/Shukofukurou-IOS/Backend/AniList.m @@ -656,8 +656,10 @@ + (void)saveuserinfoforcurrenttoken { } } else { - // Remove Account - [self removeAccount]; + if ([[error.userInfo valueForKey:@"NSLocalizedDescription"] isEqualToString:@"Request failed: unauthorized (401)"] || [[error.userInfo valueForKey:@"NSLocalizedDescription"] isEqualToString:@"Request failed: forbidden (403)"]) { + // Remove Account + [self removeAccount]; + } } } @end diff --git a/Shukofukurou-IOS/Backend/Kitsu.m b/Shukofukurou-IOS/Backend/Kitsu.m index becca91d..15478db0 100644 --- a/Shukofukurou-IOS/Backend/Kitsu.m +++ b/Shukofukurou-IOS/Backend/Kitsu.m @@ -770,8 +770,10 @@ + (void)saveuserinfoforcurrenttoken { } } else { - // Remove Account - [self removeAccount]; + if ([[error.userInfo valueForKey:@"NSLocalizedDescription"] isEqualToString:@"Request failed: unauthorized (401)"] || [[error.userInfo valueForKey:@"NSLocalizedDescription"] isEqualToString:@"Request failed: forbidden (403)"]) { + // Remove Account + [self removeAccount]; + } } } @end diff --git a/Shukofukurou-IOS/Info.plist b/Shukofukurou-IOS/Info.plist index 5e443380..9f069345 100644 --- a/Shukofukurou-IOS/Info.plist +++ b/Shukofukurou-IOS/Info.plist @@ -32,7 +32,7 @@ CFBundleVersion - 20190120 + 20190127 LSRequiresIPhoneOS UIBackgroundModes diff --git a/dependencies/ActionSheetPicker/CoreActionSheetPicker/CoreActionSheetPicker.xcodeproj/xcuserdata/koufuuchino.xcuserdatad/xcschemes/xcschememanagement.plist b/dependencies/ActionSheetPicker/CoreActionSheetPicker/CoreActionSheetPicker.xcodeproj/xcuserdata/koufuuchino.xcuserdatad/xcschemes/xcschememanagement.plist index af8beee3..2528495b 100644 --- a/dependencies/ActionSheetPicker/CoreActionSheetPicker/CoreActionSheetPicker.xcodeproj/xcuserdata/koufuuchino.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/dependencies/ActionSheetPicker/CoreActionSheetPicker/CoreActionSheetPicker.xcodeproj/xcuserdata/koufuuchino.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ CoreActionSheetPicker.xcscheme_^#shared#^_ orderHint - 13 + 14 diff --git a/dependencies/MGSwipeTableCell/MGSwipeTableCell.xcodeproj/xcuserdata/koufuuchino.xcuserdatad/xcschemes/xcschememanagement.plist b/dependencies/MGSwipeTableCell/MGSwipeTableCell.xcodeproj/xcuserdata/koufuuchino.xcuserdatad/xcschemes/xcschememanagement.plist index 982a2449..355fbbb1 100644 --- a/dependencies/MGSwipeTableCell/MGSwipeTableCell.xcodeproj/xcuserdata/koufuuchino.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/dependencies/MGSwipeTableCell/MGSwipeTableCell.xcodeproj/xcuserdata/koufuuchino.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ MGSwipeTableCell.xcscheme_^#shared#^_ orderHint - 15 + 10 diff --git a/dependencies/SDWebImage-master/.gitattributes b/dependencies/SDWebImage-master/.gitattributes old mode 100755 new mode 100644 diff --git a/dependencies/SDWebImage-master/.github/CONTRIBUTING.md b/dependencies/SDWebImage-master/.github/CONTRIBUTING.md old mode 100755 new mode 100644 diff --git a/dependencies/SDWebImage-master/.github/ISSUE_TEMPLATE.md b/dependencies/SDWebImage-master/.github/ISSUE_TEMPLATE.md old mode 100755 new mode 100644 diff --git a/dependencies/SDWebImage-master/.github/PULL_REQUEST_TEMPLATE.md b/dependencies/SDWebImage-master/.github/PULL_REQUEST_TEMPLATE.md old mode 100755 new mode 100644 diff --git a/dependencies/SDWebImage-master/.gitignore b/dependencies/SDWebImage-master/.gitignore old mode 100755 new mode 100644 diff --git a/dependencies/SDWebImage-master/.gitmodules b/dependencies/SDWebImage-master/.gitmodules old mode 100755 new mode 100644 diff --git a/dependencies/SDWebImage-master/.travis.yml b/dependencies/SDWebImage-master/.travis.yml old mode 100755 new mode 100644 diff --git a/dependencies/SDWebImage-master/CHANGELOG.md b/dependencies/SDWebImage-master/CHANGELOG.md index 7a82f75f..ea6f82fd 100644 --- a/dependencies/SDWebImage-master/CHANGELOG.md +++ b/dependencies/SDWebImage-master/CHANGELOG.md @@ -1,5 +1,30 @@ -## [4.4.2 - 4.4 patch, on July 18th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.4.2) -See [all tickets marked for the 4.4.2 release](https://github.com/rs/SDWebImage/milestone/27) +## [4.4.3 - 4.4 patch, on Nov 25th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.3) +See [all tickets marked for the 4.4.3 release](https://github.com/SDWebImage/SDWebImage/milestone/28) + +#### Fixes +- Revert the hack code for `FLAnimatedImage`, because of the `FLAnimatedImage` initializer method blocks the main queue #2441 +- Fix extention long length of file name #2516 6c6d848 +- Fix resource key invalid when clean cached disk file #2463 +- Fix the test case `testFLAnimatedImageViewSetImageWithURL` because of remote resource is not available #2450 +- Add default `HTTP User-Agent` for specific system #2409 +- Add `SDImageFormatHEIF` represent `mif1` && `msf1` brands #2423 +- remove `addProgressCallback`, add `createDownloaderOperationWithUrl` #2336 +- Fix the bug when `FLAnimatedImageView` firstly show one EXIF rotation JPEG `UIImage`, later animated GIF `FLAnimatedImage` will also be rotated #2406 +- Replace `SDWebImageDownloaderOperation` with `NSOperation` to make generic #2397 +- Fix wrong image cache type when disk and memory cache missed #2529 +- Fix FLAnimatedImage version check issue for custom property `optimalFrameCacheSize` && `predrawingEnabled` #2543 + +#### Performances +- Add autoreleasepool to release autorelease objects in advance when using GCD for 4.x #2475 +- Optimize when scale = 1 #2520 + +#### Docs +- Updated URLs after project was transfered to [SDWebImage organization](https://github.com/SDWebImage) #2510 f9d05d9 +- Tidy up spacing for `README.md` #2511 +- Remove versioneye from README #2424 + +## [4.4.2 - 4.4 patch, on July 18th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.2) +See [all tickets marked for the 4.4.2 release](https://github.com/SDWebImage/SDWebImage/milestone/27) #### Features - Ability to change the clear cache option `SDImageCacheConfig.diskCacheExpireType` #2357 @@ -14,8 +39,8 @@ See [all tickets marked for the 4.4.2 release](https://github.com/rs/SDWebImage/ - Check for nullable key when cancel image load operation #2386 - Replace `__bridge_transfer` with `__bridge` when convert from `CFStringRef` to `NSString` #2394 -## [4.4.1 - 4.4 patch, on June 7th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.4.1) -See [all tickets marked for the 4.4.1 release](https://github.com/rs/SDWebImage/milestone/26) +## [4.4.1 - 4.4 patch, on June 7th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.1) +See [all tickets marked for the 4.4.1 release](https://github.com/SDWebImage/SDWebImage/milestone/26) #### Fixes - Coder @@ -23,8 +48,8 @@ See [all tickets marked for the 4.4.1 release](https://github.com/rs/SDWebImage/ - Downloader - Fix that the downloader operation may not call the completion block when requesting the same image url in race condition #2346 #2344 -## [4.4.0 - watchOS View Category, on May 31st, 2018](https://github.com/rs/SDWebImage/releases/tag/4.4.0) -See [all tickets marked for the 4.4.0 release](https://github.com/rs/SDWebImage/milestone/25) +## [4.4.0 - watchOS View Category, on May 31st, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.4.0) +See [all tickets marked for the 4.4.0 release](https://github.com/SDWebImage/SDWebImage/milestone/25) #### Features - View Category @@ -56,8 +81,8 @@ See [all tickets marked for the 4.4.0 release](https://github.com/rs/SDWebImage/ #### Docs - Fix function storeImageDataToDisk description #2301 -## [4.3.3 - Cache Serializer, on Mar 12th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.3.3) -See [all tickets marked for the 4.3.3 release](https://github.com/rs/SDWebImage/milestone/24) +## [4.3.3 - Cache Serializer, on Mar 12th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.3) +See [all tickets marked for the 4.3.3 release](https://github.com/SDWebImage/SDWebImage/milestone/24) #### Features - Manager @@ -69,8 +94,8 @@ See [all tickets marked for the 4.3.3 release](https://github.com/rs/SDWebImage/ - Enable CLANG\_WARN\_OBJC\_IMPLICIT\_RETAIN\_SELF and fix warning #2242 -## [4.3.2 - 4.3 Patch, on Feb 28th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.3.2) -See [all tickets marked for the 4.3.2 release](https://github.com/rs/SDWebImage/milestone/23) +## [4.3.2 - 4.3 Patch, on Feb 28th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.2) +See [all tickets marked for the 4.3.2 release](https://github.com/SDWebImage/SDWebImage/milestone/23) #### Fixes - Download Operation @@ -80,8 +105,8 @@ See [all tickets marked for the 4.3.2 release](https://github.com/rs/SDWebImage/ - Downloader - Follow Apple's doc, add NSOperation only after all configuration done #2232 -## [4.3.1 - 4.3 Patch, on Feb 25th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.3.1) -See [all tickets marked for the 4.3.1 release](https://github.com/rs/SDWebImage/milestone/22) +## [4.3.1 - 4.3 Patch, on Feb 25th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.1) +See [all tickets marked for the 4.3.1 release](https://github.com/SDWebImage/SDWebImage/milestone/22) #### Fixes - Cache @@ -106,8 +131,8 @@ See [all tickets marked for the 4.3.1 release](https://github.com/rs/SDWebImage/ - Fix CLANG\_WARN\_OBJC\_IMPLICIT\_RETAIN\_SELF warning #2225 -## [4.3.0 - Image Progress & Transition, on Jan 31th, 2018](https://github.com/rs/SDWebImage/releases/tag/4.3.0) -See [all tickets marked for the 4.3.0 release](https://github.com/rs/SDWebImage/milestone/21) +## [4.3.0 - Image Progress & Transition, on Jan 31th, 2018](https://github.com/SDWebImage/SDWebImage/releases/tag/4.3.0) +See [all tickets marked for the 4.3.0 release](https://github.com/SDWebImage/SDWebImage/milestone/21) #### Features - View Category @@ -151,8 +176,8 @@ See [all tickets marked for the 4.3.0 release](https://github.com/rs/SDWebImage/ - Project - Update the spec file to define the dependency version for libwebp #2169 -## [4.2.3 - 4.2 Patch, on Nov 30th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.2.3) -See [all tickets marked for the 4.2.3 release](https://github.com/rs/SDWebImage/milestone/20) +## [4.2.3 - 4.2 Patch, on Nov 30th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.2.3) +See [all tickets marked for the 4.2.3 release](https://github.com/SDWebImage/SDWebImage/milestone/20) #### Features - Add a public API to allow user to invalidate URLSession used in SDWebImageDownloader to avoid memory leak on non-singleton instance #2116 @@ -170,8 +195,8 @@ See [all tickets marked for the 4.2.3 release](https://github.com/rs/SDWebImage/ - Adopt the current requirement, change ImageIO coder's canDecodeFromHEIC to actual implementation #2146 #2138 - When store image with no data for SDImageCache, check whether it contains alpha to use PNG or JPEG format #2136 -## [4.2.2 - 4.2 Patch, on Nov 7th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.2.2) -See [all tickets marked for the 4.2.2 release](https://github.com/rs/SDWebImage/milestone/19) +## [4.2.2 - 4.2 Patch, on Nov 7th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.2.2) +See [all tickets marked for the 4.2.2 release](https://github.com/SDWebImage/SDWebImage/milestone/19) #### Features - Update our iOS demo to modern way, add a `UIProgressView` to show image download progress #2096 @@ -180,8 +205,8 @@ See [all tickets marked for the 4.2.2 release](https://github.com/rs/SDWebImage/ - Fix that completion block and set image block are called asynchronously for `UIView+WebCache` #2093 #2097 #2092 - Fix WebP progressive decoding may do extra calculate #2095 -## [4.2.1 - 4.2 Patch, on Oct 31st, 2017](https://github.com/rs/SDWebImage/releases/tag/4.2.1) -See [all tickets marked for the 4.2.1 release](https://github.com/rs/SDWebImage/milestone/18) +## [4.2.1 - 4.2 Patch, on Oct 31st, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.2.1) +See [all tickets marked for the 4.2.1 release](https://github.com/SDWebImage/SDWebImage/milestone/18) #### Features - Feature refactor built-in coders and support animated webp on macOS #2082 (reusable code into `SDWebImageCoderHelper`; `SDWebImageFrame` abstracts animated images frames) @@ -189,8 +214,8 @@ See [all tickets marked for the 4.2.1 release](https://github.com/rs/SDWebImage/ #### Fixes - Fixed EXIF orientation method will crash on iOS 7 because it’s an iOS 8 above API #2082 -## [4.2.0 - Pluginable coders, on Oct 30th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.2.0) -See [all tickets marked for the 4.2.0 release](https://github.com/rs/SDWebImage/milestone/16) +## [4.2.0 - Pluginable coders, on Oct 30th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.2.0) +See [all tickets marked for the 4.2.0 release](https://github.com/SDWebImage/SDWebImage/milestone/16) #### Features - Refactor decoding code and provide decoding plugin #1991 @@ -214,8 +239,8 @@ See [all tickets marked for the 4.2.0 release](https://github.com/rs/SDWebImage/ #### Docs - Updated diagrams -## [4.1.2 - 4.1 patch, on Oct 9th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.1.2) -See [all tickets marked for the 4.1.2 release](https://github.com/rs/SDWebImage/milestone/17) +## [4.1.2 - 4.1 patch, on Oct 9th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.1.2) +See [all tickets marked for the 4.1.2 release](https://github.com/SDWebImage/SDWebImage/milestone/17) #### Fixes @@ -223,8 +248,8 @@ See [all tickets marked for the 4.1.2 release](https://github.com/rs/SDWebImage/ - Static `WebP` decoding little enhancement. Do not need create `WebP` iterator for static images #2050 - Change `finished` check from `equal` to `equal or greater than` to protect accident condition #2051 -## [4.1.1 - 4.1 patch, on Oct 6th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.1.1) -See [all tickets marked for the 4.1.1 release](https://github.com/rs/SDWebImage/milestone/14) +## [4.1.1 - 4.1 patch, on Oct 6th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.1.1) +See [all tickets marked for the 4.1.1 release](https://github.com/SDWebImage/SDWebImage/milestone/14) #### Fixes @@ -251,8 +276,8 @@ See [all tickets marked for the 4.1.1 release](https://github.com/rs/SDWebImage/ - Updated *Manual Installation* section #2030 fixes #2012 -## [4.1.0 - Swift API cleanup, on Jul 31st, 2017](https://github.com/rs/SDWebImage/releases/tag/4.1.0) -See [all tickets marked for the 4.1.0 release](https://github.com/rs/SDWebImage/milestone/13) +## [4.1.0 - Swift API cleanup, on Jul 31st, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.1.0) +See [all tickets marked for the 4.1.0 release](https://github.com/SDWebImage/SDWebImage/milestone/13) #### Features @@ -281,14 +306,14 @@ See [all tickets marked for the 4.1.0 release](https://github.com/rs/SDWebImage/ - #1778 #1779 #1788 #1799 b1c3bb7 (replaces #1806) 0df32ea #1847 5eb83c3 (replaces #1828) #1946 #1966 -## [4.0.0 - New platforms (Mac OS X and watchOS) + refactoring, on Jan 28th, 2017](https://github.com/rs/SDWebImage/releases/tag/4.0.0) +## [4.0.0 - New platforms (Mac OS X and watchOS) + refactoring, on Jan 28th, 2017](https://github.com/SDWebImage/SDWebImage/releases/tag/4.0.0) -See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/milestone/3) +See [all tickets marked for the 4.0.0 release](https://github.com/SDWebImage/SDWebImage/milestone/3) Versions 4.0.0-beta and 4.0.0-beta 2 list all the changes. -## [4.0.0 beta 2 - New platforms (Mac OS X and watchOS) + refactoring, on Oct 6th, 2016](https://github.com/rs/SDWebImage/releases/tag/4.0.0-beta2) +## [4.0.0 beta 2 - New platforms (Mac OS X and watchOS) + refactoring, on Oct 6th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/4.0.0-beta2) -See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/milestone/3) +See [all tickets marked for the 4.0.0 release](https://github.com/SDWebImage/SDWebImage/milestone/3) #### Features @@ -298,9 +323,9 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Fixed #1668 CGContextDrawImage: invalid context 0x0 - b366d84 -## [4.0.0 beta - New platforms (Mac OS X and watchOS) + refactoring, on Oct 5th, 2016](https://github.com/rs/SDWebImage/releases/tag/4.0.0-beta) +## [4.0.0 beta - New platforms (Mac OS X and watchOS) + refactoring, on Oct 5th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/4.0.0-beta) -See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/milestone/3) +See [all tickets marked for the 4.0.0 release](https://github.com/SDWebImage/SDWebImage/milestone/3) #### Infrastructure: @@ -318,7 +343,7 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - `SDWebImage TV Demo` - `SDWebImage Watch Demo` - bumped `libwep` version to `0.5.1` -- improved unit testing code coverage (*35%* -> **77%**) and integrated [CodeCov](https://codecov.io/gh/rs/SDWebImage) +- improved unit testing code coverage (*35%* -> **77%**) and integrated [CodeCov](https://codecov.io/gh/SDWebImage/SDWebImage) #### Backwards incompatible changes @@ -400,20 +425,20 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Fixed #1089 by updating the docs on the calling queue for the `progressBlock` (background queue) - Fixed a compilation issue on `FLAnimatedImageView+WebCache` - #1687 -## [3.8.2 Patch release for 3.8.0 on Sep 5th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.8.2) +## [3.8.2 Patch release for 3.8.0 on Sep 5th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.8.2) #### Fixes: - Fixed #1608 #1623 #1644 Crash in `[NSURLCache cachedResponseForRequest:]` - the fix is actually avoiding to access `NSURLCache` which appears to generate a race condition. We only call it if necesarry (`SDWebImageRefreshCached` is used and the image cannot be cached by the system when it's too big or behind authentication) -## [3.8.1 Patch release for 3.8.0 on Jun 7th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.8.1) +## [3.8.1 Patch release for 3.8.0 on Jun 7th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.8.1) #### Fixes: - SDWebImage 3.8.0 get wrong image #1589 - the issue was caused by the changes in 3.8.0 (Removed the URL query params from the filename (key) fb0cdb6d 1bf62d4 #1584 - fixes #1433 #1553 #1583 #1585) - Reverted. - Note: The solution for those issues (i.e. #1433 #1553) is to set the `SDWebImageManager` `cacheKeyFilter` block and do their own calculations there. -## [3.8.0 Minor release - Replaces NSURLConnection (deprecated) with NSURLSession - on Jun 6th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.8.0) +## [3.8.0 Minor release - Replaces NSURLConnection (deprecated) with NSURLSession - on Jun 6th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.8.0) #### Infrastructure: @@ -430,7 +455,7 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Fixed the WebP build with the official 1.0.0 CocoaPods release f1a471e - fixes #1444 - Updated doc: `removeImageForKey:` not synchronous e6e5c51 - fixes #1379 #1415 -## [3.7.6 Patch release for 3.7.0 on May 8th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.7.6) +## [3.7.6 Patch release for 3.7.0 on May 8th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.6) #### Infrastructure: - Changed the **libwebp git url** so that people from China can access it - #1390 (from `https://chromium.googlesource.com/webm/libwebp` to `https://github.com/webmproject/libwebp`) @@ -450,11 +475,11 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Protect against malformed frame for GIFs - #1447 - updated doc: #1462 #1466 #1486 #1532 #1461 -## [3.7.5 Patch release for 3.7.0 on Jan 21st, 2016](https://github.com/rs/SDWebImage/releases/tag/3.7.5) +## [3.7.5 Patch release for 3.7.0 on Jan 21st, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.5) - fixed #1425 and #1426 - Continuation of Fix #1366, addresses #1350 and reverts a part of #1221 - from commit 6406d8e, the wrong usage of `dispatch_apply` - fixed #1422 - Added a fallback for #976 so that if there are images saved with the old format (no extension), they can still be loaded -## [3.7.4 Patch release for 3.7.0 with tvOS support on Jan 8th, 2016](https://github.com/rs/SDWebImage/releases/tag/3.7.4) +## [3.7.4 Patch release for 3.7.0 with tvOS support on Jan 8th, 2016](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.4) #### Updates - bumped `libwep` version to `0.4.4` @@ -491,134 +516,134 @@ See [all tickets marked for the 4.0.0 release](https://github.com/rs/SDWebImage/ - Remove logging from the image prefetcher - #1276 - Fix typos #1256 #1257 #1258 #1331 #1290 -## [3.7.3 Patch release for 3.7.0 with iOS8+ framework and Carthage on Jun 13th, 2015](https://github.com/rs/SDWebImage/releases/tag/3.7.3) - -- Adds support for **iOS 8+ Framework and Carthage** [#1071](https://github.com/rs/SDWebImage/pull/1071) [#1081](https://github.com/rs/SDWebImage/pull/1081) [#1101](https://github.com/rs/SDWebImage/pull/1101) - -- [Refactor] Use `NSMutableSet` for failed URLs' storage instead of array [#1076](https://github.com/rs/SDWebImage/pull/1076) -- Make a constant for the error domain [#1011](https://github.com/rs/SDWebImage/pull/1011) -- Improve operation behavior [#988](https://github.com/rs/SDWebImage/pull/988) -- Bug fix: `Collection <__NSArrayM: > was mutated while being enumerated` [#985](https://github.com/rs/SDWebImage/pull/985) -- added `SDWebImageAvoidAutoSetImage` option to avoid automatic image addition in `UIImageView` and let developer to do it himself [#1188](https://github.com/rs/SDWebImage/pull/1188) -- Added support for custom disk cache folder with fall back for caches directory [#1153](https://github.com/rs/SDWebImage/pull/1153) -- Added some files to the workspace so they are easier to edit [8431481](https://github.com/rs/SDWebImage/commit/8431481) -- Doc update [72ed897](https://github.com/rs/SDWebImage/commit/72ed897) [7f99c01](https://github.com/rs/SDWebImage/commit/7f99c01) [#1016](https://github.com/rs/SDWebImage/pull/1016) [#1038](https://github.com/rs/SDWebImage/pull/1038) [#1045](https://github.com/rs/SDWebImage/pull/1045) -- [Memory Issue] Clear `SDWebImagePrefetcher` `progressBlock` when it has completed [#1017](https://github.com/rs/SDWebImage/pull/1017) -- avoid warning `: ImageIO: CGImageSourceCreateWithData data parameter is nil` if `imageData` is nil [88ee3c6](https://github.com/rs/SDWebImage/commit/88ee3c6) [#1018](https://github.com/rs/SDWebImage/pull/1018) -- allow override `diskCachePath` [#1041](https://github.com/rs/SDWebImage/pull/1041) -- Use `__typeof(self)` when assigning `weak` reference for block [#1054](https://github.com/rs/SDWebImage/pull/1054) -- [Refactor] Implement cache cost calculation as a inline function [#1075](https://github.com/rs/SDWebImage/pull/1075) -- @3x support [9620fff](https://github.com/rs/SDWebImage/commit/9620fff) [#1005](https://github.com/rs/SDWebImage/pull/1005) -- Fix parenthesis to avoid crashes [#1104](https://github.com/rs/SDWebImage/pull/1104) -- Add `NSCache` countLimit property [#1140](https://github.com/rs/SDWebImage/pull/1140) -- `failedURLs` can be removed at the appropriate time [#1111](https://github.com/rs/SDWebImage/pull/1111) -- Purge `NSCache` on system memory notifications [#1143](https://github.com/rs/SDWebImage/pull/1143) -- Determines at runtime is `UIApplication` is available as per [#1082](https://github.com/rs/SDWebImage/issues/1082) [#1085](https://github.com/rs/SDWebImage/pull/1085) -- Fixes http://git.chromium.org/webm/libwebp.git/info/refs not valid [#1175](https://github.com/rs/SDWebImage/pull/1175) + Reverted [#1193](https://github.com/rs/SDWebImage/pull/1193) + [#1177](https://github.com/rs/SDWebImage/pull/1177) -- 404 image url was causing the test to fail [0e761f4](https://github.com/rs/SDWebImage/commit/0e761f4) -- Fix for transparency being lost in transformed images. [#1121](https://github.com/rs/SDWebImage/pull/1121) -- Add handling for additional error codes that shouldn't be considered a permanent failure [#1159](https://github.com/rs/SDWebImage/pull/1159) -- add webp accepted content type only if `WebP` enabled [#1178](https://github.com/rs/SDWebImage/pull/1178) -- fix `ImageIO: CGImageSourceCreateWithData` data parameter is nil [#1167](https://github.com/rs/SDWebImage/pull/1167) -- Applied patch for issue [#1074](https://github.com/rs/SDWebImage/issues/1074) SDWebImage residing in swift module breaks the debugger [#1138](https://github.com/rs/SDWebImage/pull/1138) -- Fixed URLs with trailing parameters get assigned an incorrect image scale value [#1157](https://github.com/rs/SDWebImage/issues/1157) [#1158](https://github.com/rs/SDWebImage/pull/1158) -- Add newline to avoid compiler warning in `WebImage.h` [#1199](https://github.com/rs/SDWebImage/pull/1199) - -## [3.7.2 Updated patch release for 3.7.0 on Mar 17th, 2015](https://github.com/rs/SDWebImage/releases/tag/3.7.2) +## [3.7.3 Patch release for 3.7.0 with iOS8+ framework and Carthage on Jun 13th, 2015](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.3) + +- Adds support for **iOS 8+ Framework and Carthage** [#1071](https://github.com/SDWebImage/SDWebImage/pull/1071) [#1081](https://github.com/SDWebImage/SDWebImage/pull/1081) [#1101](https://github.com/SDWebImage/SDWebImage/pull/1101) + +- [Refactor] Use `NSMutableSet` for failed URLs' storage instead of array [#1076](https://github.com/SDWebImage/SDWebImage/pull/1076) +- Make a constant for the error domain [#1011](https://github.com/SDWebImage/SDWebImage/pull/1011) +- Improve operation behavior [#988](https://github.com/SDWebImage/SDWebImage/pull/988) +- Bug fix: `Collection <__NSArrayM: > was mutated while being enumerated` [#985](https://github.com/SDWebImage/SDWebImage/pull/985) +- added `SDWebImageAvoidAutoSetImage` option to avoid automatic image addition in `UIImageView` and let developer to do it himself [#1188](https://github.com/SDWebImage/SDWebImage/pull/1188) +- Added support for custom disk cache folder with fall back for caches directory [#1153](https://github.com/SDWebImage/SDWebImage/pull/1153) +- Added some files to the workspace so they are easier to edit [8431481](https://github.com/SDWebImage/SDWebImage/commit/8431481) +- Doc update [72ed897](https://github.com/SDWebImage/SDWebImage/commit/72ed897) [7f99c01](https://github.com/SDWebImage/SDWebImage/commit/7f99c01) [#1016](https://github.com/SDWebImage/SDWebImage/pull/1016) [#1038](https://github.com/SDWebImage/SDWebImage/pull/1038) [#1045](https://github.com/SDWebImage/SDWebImage/pull/1045) +- [Memory Issue] Clear `SDWebImagePrefetcher` `progressBlock` when it has completed [#1017](https://github.com/SDWebImage/SDWebImage/pull/1017) +- avoid warning `: ImageIO: CGImageSourceCreateWithData data parameter is nil` if `imageData` is nil [88ee3c6](https://github.com/SDWebImage/SDWebImage/commit/88ee3c6) [#1018](https://github.com/SDWebImage/SDWebImage/pull/1018) +- allow override `diskCachePath` [#1041](https://github.com/SDWebImage/SDWebImage/pull/1041) +- Use `__typeof(self)` when assigning `weak` reference for block [#1054](https://github.com/SDWebImage/SDWebImage/pull/1054) +- [Refactor] Implement cache cost calculation as a inline function [#1075](https://github.com/SDWebImage/SDWebImage/pull/1075) +- @3x support [9620fff](https://github.com/SDWebImage/SDWebImage/commit/9620fff) [#1005](https://github.com/SDWebImage/SDWebImage/pull/1005) +- Fix parenthesis to avoid crashes [#1104](https://github.com/SDWebImage/SDWebImage/pull/1104) +- Add `NSCache` countLimit property [#1140](https://github.com/SDWebImage/SDWebImage/pull/1140) +- `failedURLs` can be removed at the appropriate time [#1111](https://github.com/SDWebImage/SDWebImage/pull/1111) +- Purge `NSCache` on system memory notifications [#1143](https://github.com/SDWebImage/SDWebImage/pull/1143) +- Determines at runtime is `UIApplication` is available as per [#1082](https://github.com/SDWebImage/SDWebImage/issues/1082) [#1085](https://github.com/SDWebImage/SDWebImage/pull/1085) +- Fixes http://git.chromium.org/webm/libwebp.git/info/refs not valid [#1175](https://github.com/SDWebImage/SDWebImage/pull/1175) + Reverted [#1193](https://github.com/SDWebImage/SDWebImage/pull/1193) + [#1177](https://github.com/SDWebImage/SDWebImage/pull/1177) +- 404 image url was causing the test to fail [0e761f4](https://github.com/SDWebImage/SDWebImage/commit/0e761f4) +- Fix for transparency being lost in transformed images. [#1121](https://github.com/SDWebImage/SDWebImage/pull/1121) +- Add handling for additional error codes that shouldn't be considered a permanent failure [#1159](https://github.com/SDWebImage/SDWebImage/pull/1159) +- add webp accepted content type only if `WebP` enabled [#1178](https://github.com/SDWebImage/SDWebImage/pull/1178) +- fix `ImageIO: CGImageSourceCreateWithData` data parameter is nil [#1167](https://github.com/SDWebImage/SDWebImage/pull/1167) +- Applied patch for issue [#1074](https://github.com/SDWebImage/SDWebImage/issues/1074) SDWebImage residing in swift module breaks the debugger [#1138](https://github.com/SDWebImage/SDWebImage/pull/1138) +- Fixed URLs with trailing parameters get assigned an incorrect image scale value [#1157](https://github.com/SDWebImage/SDWebImage/issues/1157) [#1158](https://github.com/SDWebImage/SDWebImage/pull/1158) +- Add newline to avoid compiler warning in `WebImage.h` [#1199](https://github.com/SDWebImage/SDWebImage/pull/1199) + +## [3.7.2 Updated patch release for 3.7.0 on Mar 17th, 2015](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.2) #### Updates - bumped `libwep` version to `0.4.3` #### Features: -- implement `SDWebImageDownloaderAllowInvalidSSLCertificates` option - [#937](https://github.com/rs/SDWebImage/pull/937) -- flag to transform animated images (`SDWebImageTransformAnimatedImage`) - [#703](https://github.com/rs/SDWebImage/pull/703) -- allows user to override default `SDWebImageDownloaderOperation` - [#876](https://github.com/rs/SDWebImage/pull/876) -- adds option to decompress images and select prefetcher queue - [#996](https://github.com/rs/SDWebImage/pull/996) +- implement `SDWebImageDownloaderAllowInvalidSSLCertificates` option - [#937](https://github.com/SDWebImage/SDWebImage/pull/937) +- flag to transform animated images (`SDWebImageTransformAnimatedImage`) - [#703](https://github.com/SDWebImage/SDWebImage/pull/703) +- allows user to override default `SDWebImageDownloaderOperation` - [#876](https://github.com/SDWebImage/SDWebImage/pull/876) +- adds option to decompress images and select prefetcher queue - [#996](https://github.com/SDWebImage/SDWebImage/pull/996) #### Fixes: -- fixed [#809](https://github.com/rs/SDWebImage/issues/809) `cancelAll` crash - [#838](https://github.com/rs/SDWebImage/pull/838) -- fixed [#900](https://github.com/rs/SDWebImage/issues/900) by adding a new flag `SD_LOG_NONE` that allows silencing the SD logs from the Prefetcher -- fixed [#895](https://github.com/rs/SDWebImage/issues/895) unsafe setImage in `setImageWithURL:` - [#896](https://github.com/rs/SDWebImage/pull/896) -- fix `NSNotificationCenter` dispatch on subthreads - [#987](https://github.com/rs/SDWebImage/pull/987) -- fix `SDWebImageDownloader` threading issue - [#104](https://github.com/rs/SDWebImage/pull/104)6 -- fixed duplicate failed urls are added into `failedURLs` - [#994](https://github.com/rs/SDWebImage/pull/994) -- increased default `maxConcurrentOperationCount`, fixes [#527](https://github.com/rs/SDWebImage/issues/527) - [#897](https://github.com/rs/SDWebImage/pull/897) -- handle empty urls `NSArray` - [#929](https://github.com/rs/SDWebImage/pull/929) -- decoding webp, depends on source image data alpha status - [#936](https://github.com/rs/SDWebImage/pull/936) -- fix [#610](https://github.com/rs/SDWebImage/issues/610) display progressive jpeg issue - [#840](https://github.com/rs/SDWebImage/pull/840) -- the code from `SDWebImageDownloaderOperation connection:didFailWithError:` should match the code from `connectionDidFinishLoading:`. This fixes [#872](https://github.com/rs/SDWebImage/issues/872) - [7f39e5e](https://github.com/rs/SDWebImage/commit/7f39e5e) -- `304 - Not Modified` HTTP status code handling - [#942](https://github.com/rs/SDWebImage/pull/942) -- cost compute fix - [#941](https://github.com/rs/SDWebImage/pull/941) -- initialise `kPNGSignatureData` data - [#981](https://github.com/rs/SDWebImage/pull/981) +- fixed [#809](https://github.com/SDWebImage/SDWebImage/issues/809) `cancelAll` crash - [#838](https://github.com/SDWebImage/SDWebImage/pull/838) +- fixed [#900](https://github.com/SDWebImage/SDWebImage/issues/900) by adding a new flag `SD_LOG_NONE` that allows silencing the SD logs from the Prefetcher +- fixed [#895](https://github.com/SDWebImage/SDWebImage/issues/895) unsafe setImage in `setImageWithURL:` - [#896](https://github.com/SDWebImage/SDWebImage/pull/896) +- fix `NSNotificationCenter` dispatch on subthreads - [#987](https://github.com/SDWebImage/SDWebImage/pull/987) +- fix `SDWebImageDownloader` threading issue - [#104](https://github.com/SDWebImage/SDWebImage/pull/104)6 +- fixed duplicate failed urls are added into `failedURLs` - [#994](https://github.com/SDWebImage/SDWebImage/pull/994) +- increased default `maxConcurrentOperationCount`, fixes [#527](https://github.com/SDWebImage/SDWebImage/issues/527) - [#897](https://github.com/SDWebImage/SDWebImage/pull/897) +- handle empty urls `NSArray` - [#929](https://github.com/SDWebImage/SDWebImage/pull/929) +- decoding webp, depends on source image data alpha status - [#936](https://github.com/SDWebImage/SDWebImage/pull/936) +- fix [#610](https://github.com/SDWebImage/SDWebImage/issues/610) display progressive jpeg issue - [#840](https://github.com/SDWebImage/SDWebImage/pull/840) +- the code from `SDWebImageDownloaderOperation connection:didFailWithError:` should match the code from `connectionDidFinishLoading:`. This fixes [#872](https://github.com/SDWebImage/SDWebImage/issues/872) - [7f39e5e](https://github.com/SDWebImage/SDWebImage/commit/7f39e5e) +- `304 - Not Modified` HTTP status code handling - [#942](https://github.com/SDWebImage/SDWebImage/pull/942) +- cost compute fix - [#941](https://github.com/SDWebImage/SDWebImage/pull/941) +- initialise `kPNGSignatureData` data - [#981](https://github.com/SDWebImage/SDWebImage/pull/981) #### Documentation - documentation updated -## [3.7.1 Patch release for 3.7.0 on Jul 23rd, 2014](https://github.com/rs/SDWebImage/releases/tag/3.7.1) +## [3.7.1 Patch release for 3.7.0 on Jul 23rd, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.1) -- fixed `sd_imageOrientationFromImageData:` crash if imageSource is nil - [#819](https://github.com/rs/SDWebImage/pull/819) [#813](https://github.com/rs/SDWebImage/pull/813) [#808](https://github.com/rs/SDWebImage/issues/808) [#828](https://github.com/rs/SDWebImage/issues/828) - temporary fix -- fixed `SDWebImageCombinedOperation cancel` crash (also visible as `SDWebImageManager cancelAll`) - [28109c4](https://github.com/rs/SDWebImage/commit/28109c4) [#798](https://github.com/rs/SDWebImage/issues/798) [#809](https://github.com/rs/SDWebImage/issues/809) -- fixed duplicate symbols when using with webp via pods - [#795](https://github.com/rs/SDWebImage/pull/795) -- fixed missing `mark` from `pragma mark` - [#827](https://github.com/rs/SDWebImage/pull/827) +- fixed `sd_imageOrientationFromImageData:` crash if imageSource is nil - [#819](https://github.com/SDWebImage/SDWebImage/pull/819) [#813](https://github.com/SDWebImage/SDWebImage/pull/813) [#808](https://github.com/SDWebImage/SDWebImage/issues/808) [#828](https://github.com/SDWebImage/SDWebImage/issues/828) - temporary fix +- fixed `SDWebImageCombinedOperation cancel` crash (also visible as `SDWebImageManager cancelAll`) - [28109c4](https://github.com/SDWebImage/SDWebImage/commit/28109c4) [#798](https://github.com/SDWebImage/SDWebImage/issues/798) [#809](https://github.com/SDWebImage/SDWebImage/issues/809) +- fixed duplicate symbols when using with webp via pods - [#795](https://github.com/SDWebImage/SDWebImage/pull/795) +- fixed missing `mark` from `pragma mark` - [#827](https://github.com/SDWebImage/SDWebImage/pull/827) -## [3.7.0 Xcode6, arm64, highlight UIImageView, imageURL ref, NTLM, ... on Jul 14th, 2014](https://github.com/rs/SDWebImage/releases/tag/3.7.0) +## [3.7.0 Xcode6, arm64, highlight UIImageView, imageURL ref, NTLM, ... on Jul 14th, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.7.0) ## Features -- Add category for imageView's highlighted state `UIImageView+HighlightedWebCache` - [#646](https://github.com/rs/SDWebImage/pull/646) [#765](https://github.com/rs/SDWebImage/pull/765) -- Keep a reference to the image URL - [#560](https://github.com/rs/SDWebImage/pull/560) -- Pass imageURL in completedBlock - [#770](https://github.com/rs/SDWebImage/pull/770) -- Implemented NTLM auth support. Replaced deprecated auth challenge methods from `NSURLConnectionDelegate` - [#711](https://github.com/rs/SDWebImage/pull/711) [50c4d1d](https://github.com/rs/SDWebImage/commit/50c4d1d) -- Ability to suspend image downloaders `SDWebImageDownloader setSuspended:` - [#734](https://github.com/rs/SDWebImage/pull/734) -- Delay the loading of the placeholder image until after load - [#701](https://github.com/rs/SDWebImage/pull/701) -- Ability to save images to cache directly - [#714](https://github.com/rs/SDWebImage/pull/714) -- Support for image orientation - [#764](https://github.com/rs/SDWebImage/pull/764) -- Added async `SDImageCache removeImageForKey:withCompletion:` - [#732](https://github.com/rs/SDWebImage/pull/732) [cd4b925](https://github.com/rs/SDWebImage/commit/cd4b925) -- Exposed cache paths - [#339](https://github.com/rs/SDWebImage/issues/339) -- Exposed `SDWebImageManager cacheKeyForURL:` - [5fd21e5](https://github.com/rs/SDWebImage/commit/5fd21e5) -- Exposing `SDWebImageManager` instance from the `SDWebImagePrefetcher` class - [6c409cd](https://github.com/rs/SDWebImage/commit/6c409cd) -- `SDWebImageManager` uses the shared instance of `SDWebImageDownloader` - [0772019](https://github.com/rs/SDWebImage/commit/0772019) -- Refactor the cancel logic - [#771](https://github.com/rs/SDWebImage/pull/771) [6d01e80](https://github.com/rs/SDWebImage/commit/6d01e80) [23874cd](https://github.com/rs/SDWebImage/commit/23874cd) [a6f11b3](https://github.com/rs/SDWebImage/commit/a6f11b3) -- Added method `SDWebImageManager cachedImageExistsForURL:` to check if an image exists in either the disk OR the memory cache - [#644](https://github.com/rs/SDWebImage/pull/644) -- Added option to use the cached image instead of the placeholder for `UIImageView`. Replaces [#541](https://github.com/rs/SDWebImage/pull/541) - [#599](https://github.com/rs/SDWebImage/issues/599) [30f6726](https://github.com/rs/SDWebImage/commit/30f6726) +- Add category for imageView's highlighted state `UIImageView+HighlightedWebCache` - [#646](https://github.com/SDWebImage/SDWebImage/pull/646) [#765](https://github.com/SDWebImage/SDWebImage/pull/765) +- Keep a reference to the image URL - [#560](https://github.com/SDWebImage/SDWebImage/pull/560) +- Pass imageURL in completedBlock - [#770](https://github.com/SDWebImage/SDWebImage/pull/770) +- Implemented NTLM auth support. Replaced deprecated auth challenge methods from `NSURLConnectionDelegate` - [#711](https://github.com/SDWebImage/SDWebImage/pull/711) [50c4d1d](https://github.com/SDWebImage/SDWebImage/commit/50c4d1d) +- Ability to suspend image downloaders `SDWebImageDownloader setSuspended:` - [#734](https://github.com/SDWebImage/SDWebImage/pull/734) +- Delay the loading of the placeholder image until after load - [#701](https://github.com/SDWebImage/SDWebImage/pull/701) +- Ability to save images to cache directly - [#714](https://github.com/SDWebImage/SDWebImage/pull/714) +- Support for image orientation - [#764](https://github.com/SDWebImage/SDWebImage/pull/764) +- Added async `SDImageCache removeImageForKey:withCompletion:` - [#732](https://github.com/SDWebImage/SDWebImage/pull/732) [cd4b925](https://github.com/SDWebImage/SDWebImage/commit/cd4b925) +- Exposed cache paths - [#339](https://github.com/SDWebImage/SDWebImage/issues/339) +- Exposed `SDWebImageManager cacheKeyForURL:` - [5fd21e5](https://github.com/SDWebImage/SDWebImage/commit/5fd21e5) +- Exposing `SDWebImageManager` instance from the `SDWebImagePrefetcher` class - [6c409cd](https://github.com/SDWebImage/SDWebImage/commit/6c409cd) +- `SDWebImageManager` uses the shared instance of `SDWebImageDownloader` - [0772019](https://github.com/SDWebImage/SDWebImage/commit/0772019) +- Refactor the cancel logic - [#771](https://github.com/SDWebImage/SDWebImage/pull/771) [6d01e80](https://github.com/SDWebImage/SDWebImage/commit/6d01e80) [23874cd](https://github.com/SDWebImage/SDWebImage/commit/23874cd) [a6f11b3](https://github.com/SDWebImage/SDWebImage/commit/a6f11b3) +- Added method `SDWebImageManager cachedImageExistsForURL:` to check if an image exists in either the disk OR the memory cache - [#644](https://github.com/SDWebImage/SDWebImage/pull/644) +- Added option to use the cached image instead of the placeholder for `UIImageView`. Replaces [#541](https://github.com/SDWebImage/SDWebImage/pull/541) - [#599](https://github.com/SDWebImage/SDWebImage/issues/599) [30f6726](https://github.com/SDWebImage/SDWebImage/commit/30f6726) - Created workspace + added unit tests target -- Updated documentation - [#476](https://github.com/rs/SDWebImage/issues/476) [#384](https://github.com/rs/SDWebImage/issues/384) [#526](https://github.com/rs/SDWebImage/issues/526) [#376](https://github.com/rs/SDWebImage/pull/376) [a8f5627](https://github.com/rs/SDWebImage/commit/a8f5627) +- Updated documentation - [#476](https://github.com/SDWebImage/SDWebImage/issues/476) [#384](https://github.com/SDWebImage/SDWebImage/issues/384) [#526](https://github.com/SDWebImage/SDWebImage/issues/526) [#376](https://github.com/SDWebImage/SDWebImage/pull/376) [a8f5627](https://github.com/SDWebImage/SDWebImage/commit/a8f5627) ## Bugfixes -- Fixed Xcode 6 builds - [#741](https://github.com/rs/SDWebImage/pull/741) [0b47342](https://github.com/rs/SDWebImage/commit/0b47342) -- Fixed `diskImageExistsWithKey:` deadlock - [#625](https://github.com/rs/SDWebImage/issues/625) [6e4fbaf](https://github.com/rs/SDWebImage/commit/6e4fbaf) +- Fixed Xcode 6 builds - [#741](https://github.com/SDWebImage/SDWebImage/pull/741) [0b47342](https://github.com/SDWebImage/SDWebImage/commit/0b47342) +- Fixed `diskImageExistsWithKey:` deadlock - [#625](https://github.com/SDWebImage/SDWebImage/issues/625) [6e4fbaf](https://github.com/SDWebImage/SDWebImage/commit/6e4fbaf) For consistency, added async methods in `SDWebImageManager` `cachedImageExistsForURL:completion:` and `diskImageExistsForURL:completion:` -- Fixed race condition that causes cancellation of one download operation to stop a run loop that is now used for another download operation. Race is introduced through `performSelector:onThread:withObject:waitUntilDone:` - [#698](https://github.com/rs/SDWebImage/pull/698) -- Fixed race condition between operation cancelation and loading finish - [39db378](https://github.com/rs/SDWebImage/commit/39db378) [#621](https://github.com/rs/SDWebImage/pull/621) [#783](https://github.com/rs/SDWebImage/pull/783) -- Fixed race condition in SDWebImageManager if one operation is cancelled - [f080e38](https://github.com/rs/SDWebImage/commit/f080e38) [#699](https://github.com/rs/SDWebImage/pull/699) -- Fixed issue where cancelled operations aren't removed from `runningOperations` - [#68](https://github.com/rs/SDWebImage/issues/68) -- Should not add url to failedURLs when timeout, cancel and so on - [#766](https://github.com/rs/SDWebImage/pull/766) [#707](https://github.com/rs/SDWebImage/issues/707) -- Fixed potential *object mutated while being enumerated* crash - [#727](https://github.com/rs/SDWebImage/pull/727) [#728](https://github.com/rs/SDWebImage/pull/728) (revert a threading fix from [#727](https://github.com/rs/SDWebImage/pull/727)) -- Fixed `NSURLConnection` response statusCode not valid (e.g. 404), downloader never stops its runloop and hangs the operation queue - [#735](https://github.com/rs/SDWebImage/pull/735) -- Fixed `SDWebImageRefreshCached` bug for large images - [#744](https://github.com/rs/SDWebImage/pull/744) -- Added proper handling for `SDWebImageDownloaderLowPriority` - [#713](https://github.com/rs/SDWebImage/issues/713) [#745](https://github.com/rs/SDWebImage/issues/745) -- Fixed fixing potential bug when sending a nil url for UIButton+WebCache - [#761](https://github.com/rs/SDWebImage/issues/761) [#763](https://github.com/rs/SDWebImage/pull/763) -- Fixed issue [#529](https://github.com/rs/SDWebImage/pull/529) - if the `cacheKeyFilter` was set, this was ignored when computing the `scaledImageForKey`. For most of the developers that did not set `cacheKeyFilter`, the code will work exactly the same - [eb91fdd](https://github.com/rs/SDWebImage/commit/eb91fdd) -- Returning error in setImage completedBlock if the url was nil. Added `dispatch_main_async_safe` macro - [#505](https://github.com/rs/SDWebImage/issues/505) [af3e4f8](https://github.com/rs/SDWebImage/commit/af3e4f8) -- Avoid premature completion of prefetcher if request fails - [#751](https://github.com/rs/SDWebImage/pull/751) -- Return nil from `SDScaledImageForKey` if the input image is nil - [#365](https://github.com/rs/SDWebImage/issues/365) [#750](https://github.com/rs/SDWebImage/pull/750) -- Do not load placeholder image if `SDWebImageDelayPlaceholder` option specified - [#780](https://github.com/rs/SDWebImage/pull/780) -- Make sure we call the `startPrefetchingAtIndex:` method from main queue - [#694](https://github.com/rs/SDWebImage/pull/694) -- Save image in cache before calling completion block - [#700](https://github.com/rs/SDWebImage/pull/700) -- Fixed arm64 warnings - [#685](https://github.com/rs/SDWebImage/pull/685) [#720](https://github.com/rs/SDWebImage/pull/720) [#721](https://github.com/rs/SDWebImage/pull/721) [#687](https://github.com/rs/SDWebImage/pull/687) -- Improved logging - [#721](https://github.com/rs/SDWebImage/pull/721) +- Fixed race condition that causes cancellation of one download operation to stop a run loop that is now used for another download operation. Race is introduced through `performSelector:onThread:withObject:waitUntilDone:` - [#698](https://github.com/SDWebImage/SDWebImage/pull/698) +- Fixed race condition between operation cancelation and loading finish - [39db378](https://github.com/SDWebImage/SDWebImage/commit/39db378) [#621](https://github.com/SDWebImage/SDWebImage/pull/621) [#783](https://github.com/SDWebImage/SDWebImage/pull/783) +- Fixed race condition in SDWebImageManager if one operation is cancelled - [f080e38](https://github.com/SDWebImage/SDWebImage/commit/f080e38) [#699](https://github.com/SDWebImage/SDWebImage/pull/699) +- Fixed issue where cancelled operations aren't removed from `runningOperations` - [#68](https://github.com/SDWebImage/SDWebImage/issues/68) +- Should not add url to failedURLs when timeout, cancel and so on - [#766](https://github.com/SDWebImage/SDWebImage/pull/766) [#707](https://github.com/SDWebImage/SDWebImage/issues/707) +- Fixed potential *object mutated while being enumerated* crash - [#727](https://github.com/SDWebImage/SDWebImage/pull/727) [#728](https://github.com/SDWebImage/SDWebImage/pull/728) (revert a threading fix from [#727](https://github.com/SDWebImage/SDWebImage/pull/727)) +- Fixed `NSURLConnection` response statusCode not valid (e.g. 404), downloader never stops its runloop and hangs the operation queue - [#735](https://github.com/SDWebImage/SDWebImage/pull/735) +- Fixed `SDWebImageRefreshCached` bug for large images - [#744](https://github.com/SDWebImage/SDWebImage/pull/744) +- Added proper handling for `SDWebImageDownloaderLowPriority` - [#713](https://github.com/SDWebImage/SDWebImage/issues/713) [#745](https://github.com/SDWebImage/SDWebImage/issues/745) +- Fixed fixing potential bug when sending a nil url for UIButton+WebCache - [#761](https://github.com/SDWebImage/SDWebImage/issues/761) [#763](https://github.com/SDWebImage/SDWebImage/pull/763) +- Fixed issue [#529](https://github.com/SDWebImage/SDWebImage/pull/529) - if the `cacheKeyFilter` was set, this was ignored when computing the `scaledImageForKey`. For most of the developers that did not set `cacheKeyFilter`, the code will work exactly the same - [eb91fdd](https://github.com/SDWebImage/SDWebImage/commit/eb91fdd) +- Returning error in setImage completedBlock if the url was nil. Added `dispatch_main_async_safe` macro - [#505](https://github.com/SDWebImage/SDWebImage/issues/505) [af3e4f8](https://github.com/SDWebImage/SDWebImage/commit/af3e4f8) +- Avoid premature completion of prefetcher if request fails - [#751](https://github.com/SDWebImage/SDWebImage/pull/751) +- Return nil from `SDScaledImageForKey` if the input image is nil - [#365](https://github.com/SDWebImage/SDWebImage/issues/365) [#750](https://github.com/SDWebImage/SDWebImage/pull/750) +- Do not load placeholder image if `SDWebImageDelayPlaceholder` option specified - [#780](https://github.com/SDWebImage/SDWebImage/pull/780) +- Make sure we call the `startPrefetchingAtIndex:` method from main queue - [#694](https://github.com/SDWebImage/SDWebImage/pull/694) +- Save image in cache before calling completion block - [#700](https://github.com/SDWebImage/SDWebImage/pull/700) +- Fixed arm64 warnings - [#685](https://github.com/SDWebImage/SDWebImage/pull/685) [#720](https://github.com/SDWebImage/SDWebImage/pull/720) [#721](https://github.com/SDWebImage/SDWebImage/pull/721) [#687](https://github.com/SDWebImage/SDWebImage/pull/687) +- Improved logging - [#721](https://github.com/SDWebImage/SDWebImage/pull/721) - Added `SDWebImageCompat.m` to `SDWebImage+MKAnnotation` target -## [3.6 Fix and cleanup on Mar 24th, 2014](https://github.com/rs/SDWebImage/releases/tag/3.6) +## [3.6 Fix and cleanup on Mar 24th, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.6) -## [3.5.4 ARM64 Support on Feb 24th, 2014](https://github.com/rs/SDWebImage/releases/tag/3.5.4) +## [3.5.4 ARM64 Support on Feb 24th, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5.4) -## [3.5.3 on Jan 7th, 2014](https://github.com/rs/SDWebImage/releases/tag/3.5.3) +## [3.5.3 on Jan 7th, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5.3) -## [3.5.2 on Jan 2nd, 2014](https://github.com/rs/SDWebImage/releases/tag/3.5.2) +## [3.5.2 on Jan 2nd, 2014](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5.2) -## [3.5.1 on Dec 3rd, 2013](https://github.com/rs/SDWebImage/releases/tag/3.5.1) +## [3.5.1 on Dec 3rd, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5.1) -## [3.5 WebP Target, iOS 7, Fixes on Oct 4th, 2013](https://github.com/rs/SDWebImage/releases/tag/3.5) +## [3.5 WebP Target, iOS 7, Fixes on Oct 4th, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.5) - Fix iOS 7 related issues - Move `WebP` support to a dedicated target @@ -626,68 +651,68 @@ For consistency, added async methods in `SDWebImageManager` `cachedImageExistsFo - Fix timeout issue - Add some methods that allow to check if an image exists on disk without taking it off disk and decompressing it first -## [3.4 Animated image category, bug fixes on Aug 13th, 2013](https://github.com/rs/SDWebImage/releases/tag/3.4) +## [3.4 Animated image category, bug fixes on Aug 13th, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.4) - Add `calculateSizeWithCompletionBlock` - Add multiple download of images for animationImages property of `UIImageView` -- Add background task for disk cleanup [#306](https://github.com/rs/SDWebImage/issues/306) -- Fix dead thread issue on iOS 5 [#444](https://github.com/rs/SDWebImage/pull/444), [#399](https://github.com/rs/SDWebImage/issues/399), [#466](https://github.com/rs/SDWebImage/issues/466) -- Make IO operations cancelable to fix perf issue with heavy images [#462](https://github.com/rs/SDWebImage/issues/462) -- Fix crash `Collection <__NSArrayM: ...> was mutated while being enumerated.` [#471](https://github.com/rs/SDWebImage/pull/471) +- Add background task for disk cleanup [#306](https://github.com/SDWebImage/SDWebImage/issues/306) +- Fix dead thread issue on iOS 5 [#444](https://github.com/SDWebImage/SDWebImage/pull/444), [#399](https://github.com/SDWebImage/SDWebImage/issues/399), [#466](https://github.com/SDWebImage/SDWebImage/issues/466) +- Make IO operations cancelable to fix perf issue with heavy images [#462](https://github.com/SDWebImage/SDWebImage/issues/462) +- Fix crash `Collection <__NSArrayM: ...> was mutated while being enumerated.` [#471](https://github.com/SDWebImage/SDWebImage/pull/471) -## [3.3 WebP, Animated GIF and more on Jun 14th, 2013](https://github.com/rs/SDWebImage/releases/tag/3.3) +## [3.3 WebP, Animated GIF and more on Jun 14th, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.3) -- WebP image format support [#410](https://github.com/rs/SDWebImage/issues/410) -- Animated GIF support [#375](https://github.com/rs/SDWebImage/pull/375) -- Custom image cache search paths [#156](https://github.com/rs/SDWebImage/pull/156) +- WebP image format support [#410](https://github.com/SDWebImage/SDWebImage/issues/410) +- Animated GIF support [#375](https://github.com/SDWebImage/SDWebImage/pull/375) +- Custom image cache search paths [#156](https://github.com/SDWebImage/SDWebImage/pull/156) - Bug fixes -## [3.2 Bug fixes on Mar 13th, 2013](https://github.com/rs/SDWebImage/releases/tag/3.2) +## [3.2 Bug fixes on Mar 13th, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.2) -- `SDWebImageRefreshCached` download option [#326](https://github.com/rs/SDWebImage/pull/326) -- New `SDWebImageManager` delegate methods [ebd63a88c1](https://github.com/rs/SDWebImage/commit/ebd63a88c116ac7acfbeded5c84d0fffa2443438) -- Fix long standing issue with alpha en JPEGs [#299](https://github.com/rs/SDWebImage/pull/299) -- Add synchronous disk-cache loading method [#297](https://github.com/rs/SDWebImage/pull/297) +- `SDWebImageRefreshCached` download option [#326](https://github.com/SDWebImage/SDWebImage/pull/326) +- New `SDWebImageManager` delegate methods [ebd63a88c1](https://github.com/SDWebImage/SDWebImage/commit/ebd63a88c116ac7acfbeded5c84d0fffa2443438) +- Fix long standing issue with alpha en JPEGs [#299](https://github.com/SDWebImage/SDWebImage/pull/299) +- Add synchronous disk-cache loading method [#297](https://github.com/SDWebImage/SDWebImage/pull/297) - Fix `SDWebImageCacheMemoryOnly` flag - Bug fixes -## [3.1 Bug fixes on Jan 21st, 2013](https://github.com/rs/SDWebImage/releases/tag/3.1) +## [3.1 Bug fixes on Jan 21st, 2013](https://github.com/SDWebImage/SDWebImage/releases/tag/3.1) -## [3.0 Complete rewrite on Nov 29th, 2012](https://github.com/rs/SDWebImage/releases/tag/3.0) +## [3.0 Complete rewrite on Nov 29th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/3.0) - Complete rewrite of the library using `GCD`, `ARC`, `NSCache` and blocks - Drop compatibility with iOS 3 and 4 -## [2.7.4 Bug fixes on Nov 14th, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7.4) +## [2.7.4 Bug fixes on Nov 14th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7.4) -## [2.7.3 on Nov 3rd, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7.3) +## [2.7.3 on Nov 3rd, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7.3) -## [2.7.2 on Oct 23rd, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7.2) +## [2.7.2 on Oct 23rd, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7.2) -## [2.7.1 on Oct 19th, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7.1) +## [2.7.1 on Oct 19th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7.1) -## [2.7 on Sep 8th, 2012](https://github.com/rs/SDWebImage/releases/tag/2.7) +## [2.7 on Sep 8th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.7) -## [2.6 on May 4th, 2012](https://github.com/rs/SDWebImage/releases/tag/2.6) +## [2.6 on May 4th, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.6) -## [2.5 on Mar 22nd, 2012](https://github.com/rs/SDWebImage/releases/tag/2.5) +## [2.5 on Mar 22nd, 2012](https://github.com/SDWebImage/SDWebImage/releases/tag/2.5) -## [2.4 on Oct 1st, 2011](https://github.com/rs/SDWebImage/releases/tag/2.4) +## [2.4 on Oct 1st, 2011](https://github.com/SDWebImage/SDWebImage/releases/tag/2.4) -## [2.3 on Sep 16th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.3) +## [2.3 on Sep 16th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.3) -## [2.2 on Aug 29th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.2) +## [2.2 on Aug 29th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.2) -## [2.1.0 on Jun 12th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.1.0) +## [2.1.0 on Jun 12th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.1.0) -## [2.1 on Jun 12th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.1) +## [2.1 on Jun 12th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.1) -## [2.0.0 on Jun 9th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.0.0) +## [2.0.0 on Jun 9th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.0.0) -## [2.0 on Jun 9th, 2010](https://github.com/rs/SDWebImage/releases/tag/2.0) +## [2.0 on Jun 9th, 2010](https://github.com/SDWebImage/SDWebImage/releases/tag/2.0) -## [1.0.0 on Dec 31st, 2009](https://github.com/rs/SDWebImage/releases/tag/1.0.0) +## [1.0.0 on Dec 31st, 2009](https://github.com/SDWebImage/SDWebImage/releases/tag/1.0.0) -## [1.0 on Dec 31st, 2009](https://github.com/rs/SDWebImage/releases/tag/1.0) +## [1.0 on Dec 31st, 2009](https://github.com/SDWebImage/SDWebImage/releases/tag/1.0) diff --git a/dependencies/SDWebImage-master/Docs/ManualInstallation.md b/dependencies/SDWebImage-master/Docs/ManualInstallation.md index ae059a62..b12f67db 100644 --- a/dependencies/SDWebImage-master/Docs/ManualInstallation.md +++ b/dependencies/SDWebImage-master/Docs/ManualInstallation.md @@ -2,7 +2,7 @@ In order to gain access to all the files from the repository, you should clone it. ``` -git clone --recursive https://github.com/rs/SDWebImage.git +git clone --recursive https://github.com/SDWebImage/SDWebImage.git ``` ... TO BE CHECKED AND DESCRIBED IN DETAIL diff --git a/dependencies/SDWebImage-master/Docs/SDWebImage-4.0-Migration-guide.md b/dependencies/SDWebImage-master/Docs/SDWebImage-4.0-Migration-guide.md index 486eb56c..715889c9 100644 --- a/dependencies/SDWebImage-master/Docs/SDWebImage-4.0-Migration-guide.md +++ b/dependencies/SDWebImage-master/Docs/SDWebImage-4.0-Migration-guide.md @@ -14,7 +14,7 @@ This guide is provided in order to ease the transition of existing applications SDWebImage 4.0 officially supports iOS 7 and later, Mac OS X 10.8 and later, watchOS 2 and later and tvOS 9 and later. It needs Xcode 7.3 or later to be able to build everything properly. -For targeting previous versions of the SDKs, check [README - Backwards compatibility](https://github.com/rs/SDWebImage#backwards-compatibility) +For targeting previous versions of the SDKs, check [README - Backwards compatibility](https://github.com/SDWebImage/SDWebImage#backwards-compatibility) . ### Migration diff --git a/dependencies/SDWebImage-master/README.md b/dependencies/SDWebImage-master/README.md index 82e89888..24db8487 100644 --- a/dependencies/SDWebImage-master/README.md +++ b/dependencies/SDWebImage-master/README.md @@ -1,14 +1,14 @@ -

+

-[![Build Status](http://img.shields.io/travis/rs/SDWebImage/master.svg?style=flat)](https://travis-ci.org/rs/SDWebImage) +[![Build Status](http://img.shields.io/travis/SDWebImage/SDWebImage/master.svg?style=flat)](https://travis-ci.org/SDWebImage/SDWebImage) [![Pod Version](http://img.shields.io/cocoapods/v/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) [![Pod Platform](http://img.shields.io/cocoapods/p/SDWebImage.svg?style=flat)](http://cocoadocs.org/docsets/SDWebImage/) [![Pod License](http://img.shields.io/cocoapods/l/SDWebImage.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html) -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/rs/SDWebImage) -[![codecov](https://codecov.io/gh/rs/SDWebImage/branch/master/graph/badge.svg)](https://codecov.io/gh/rs/SDWebImage) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/SDWebImage) +[![codecov](https://codecov.io/gh/SDWebImage/SDWebImage/branch/master/graph/badge.svg)](https://codecov.io/gh/SDWebImage/SDWebImage) This library provides an async image downloader with cache support. For convenience, we added categories for UI elements like `UIImageView`, `UIButton`, `MKAnnotationView`. @@ -39,22 +39,22 @@ This library provides an async image downloader with cache support. For convenie #### Backwards compatibility -- For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/rs/SDWebImage/tree/3.7.6) -- For iOS < 5.0, please use the last [2.0 version](https://github.com/rs/SDWebImage/tree/2.0-compat). +- For iOS 5 and 6, use [any 3.x version up to 3.7.6](https://github.com/SDWebImage/SDWebImage/tree/3.7.6) +- For iOS < 5.0, please use the last [2.0 version](https://github.com/SDWebImage/SDWebImage/tree/2.0-compat). ## Getting Started - Read this Readme doc -- Read the [How to use section](https://github.com/rs/SDWebImage#how-to-use) +- Read the [How to use section](https://github.com/SDWebImage/SDWebImage#how-to-use) - 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 [Installation Guide](https://github.com/SDWebImage/SDWebImage/wiki/Installation-Guide) - 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 [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) +- Read the [Common Problems](https://github.com/SDWebImage/SDWebImage/wiki/Common-Problems) to find the solution for common problems +- Go to the [Wiki Page](https://github.com/SDWebImage/SDWebImage/wiki) for more information such as [Advanced Usage](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage) ## Who Uses It -- Find out [who uses SDWebImage](https://github.com/rs/SDWebImage/wiki/Who-Uses-SDWebImage) and add your app to the list. +- Find out [who uses SDWebImage](https://github.com/SDWebImage/SDWebImage/wiki/Who-Uses-SDWebImage) and add your app to the list. ## Communication @@ -90,7 +90,7 @@ imageView.sd_setImage(with: URL(string: "http://www.domain.com/path/to/image.jpg - Starting with the 4.0 version, we rely on [FLAnimatedImage](https://github.com/Flipboard/FLAnimatedImage) to take care of our animated images. - If you use cocoapods, add `pod 'SDWebImage/GIF'` to your podfile. - To use it, simply make sure you use `FLAnimatedImageView` instead of `UIImageView`. -- **Note**: there is a backwards compatible feature, so if you are still trying to load a GIF into a `UIImageView`, it will only show the 1st frame as a static image by default. However, you can enable the full GIF support by using the built-in GIF coder. See [GIF coder](https://github.com/rs/SDWebImage/wiki/Advanced-Usage#gif-coder) +- **Note**: there is a backwards compatible feature, so if you are still trying to load a GIF into a `UIImageView`, it will only show the 1st frame as a static image by default. However, you can enable the full GIF support by using the built-in GIF coder. See [GIF coder](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#gif-coder) - **Important**: FLAnimatedImage only works on the iOS platform. For macOS, use `NSImageView` with `animates` set to `YES` to show the entire animated images and `NO` to only show the 1st frame. For all the other platforms (tvOS, watchOS) we will fallback to the backwards compatibility feature described above ## Installation @@ -110,7 +110,16 @@ platform :ios, '7.0' pod 'SDWebImage', '~> 4.0' ``` -If you are using Swift, be sure to add `use_frameworks!` and set your target to iOS 8+: +##### Swift + +If you are using `Swift`, `Xcode 9+` and `CocoaPods` `1.5.0+`, you only need to set your target to `iOS 8+` if you need static library: + +``` +platform :ios, '8.0' +``` + +If not, you still need to add `use_frameworks!` to use dynamic framework: + ``` platform :ios, '8.0' use_frameworks! @@ -133,7 +142,7 @@ To install with carthage, follow the instruction on [Carthage](https://github.co #### Cartfile ``` -github "rs/SDWebImage" +github "SDWebImage/SDWebImage" ``` ### Installation by cloning the repository @@ -164,14 +173,14 @@ community can help you solve it. ## Licenses -All source code is licensed under the [MIT License](https://raw.github.com/rs/SDWebImage/master/LICENSE). +All source code is licensed under the [MIT License](https://raw.github.com/SDWebImage/SDWebImage/master/LICENSE). ## Architecture -

+

-

+

diff --git a/dependencies/SDWebImage-master/SDWebImage.podspec b/dependencies/SDWebImage-master/SDWebImage.podspec index 8bf1867b..3b2b49a0 100644 --- a/dependencies/SDWebImage-master/SDWebImage.podspec +++ b/dependencies/SDWebImage-master/SDWebImage.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'SDWebImage' - s.version = '4.4.2' + s.version = '4.4.3' s.osx.deployment_target = '10.9' s.ios.deployment_target = '7.0' @@ -9,9 +9,9 @@ Pod::Spec.new do |s| s.license = 'MIT' s.summary = 'Asynchronous image downloader with cache support with an UIImageView category.' - s.homepage = 'https://github.com/rs/SDWebImage' + s.homepage = 'https://github.com/SDWebImage/SDWebImage' s.author = { 'Olivier Poitrey' => 'rs@dailymotion.com' } - s.source = { :git => 'https://github.com/rs/SDWebImage.git', :tag => s.version.to_s } + s.source = { :git => 'https://github.com/SDWebImage/SDWebImage.git', :tag => s.version.to_s } s.description = 'This library provides a category for UIImageView with support for remote ' \ 'images coming from the web. It provides an UIImageView category adding web ' \ @@ -23,6 +23,7 @@ Pod::Spec.new do |s| s.requires_arc = true s.framework = 'ImageIO' + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.default_subspec = 'Core' diff --git a/dependencies/SDWebImage-master/SDWebImage.xcodeproj/project.pbxproj b/dependencies/SDWebImage-master/SDWebImage.xcodeproj/project.pbxproj index 158e6699..64f5ce01 100644 --- a/dependencies/SDWebImage-master/SDWebImage.xcodeproj/project.pbxproj +++ b/dependencies/SDWebImage-master/SDWebImage.xcodeproj/project.pbxproj @@ -37,6 +37,18 @@ 00733A711BC4880E00A5A117 /* UIImageView+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 53922D95148C56230056699D /* UIImageView+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; 00733A721BC4880E00A5A117 /* UIView+WebCacheOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = AB615301192DA24600A2D8E9 /* UIView+WebCacheOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 00733A731BC4880E00A5A117 /* SDWebImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A2CAE031AB4BB5400B6BC39 /* SDWebImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0E9EFA0A21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E9EFA0821983283005D7892 /* UIImage+MemoryCacheCost.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0E9EFA0B21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E9EFA0821983283005D7892 /* UIImage+MemoryCacheCost.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0E9EFA0C21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E9EFA0821983283005D7892 /* UIImage+MemoryCacheCost.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0E9EFA0D21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E9EFA0821983283005D7892 /* UIImage+MemoryCacheCost.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0E9EFA0E21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E9EFA0821983283005D7892 /* UIImage+MemoryCacheCost.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0E9EFA0F21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E9EFA0821983283005D7892 /* UIImage+MemoryCacheCost.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0E9EFA1021983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9EFA0921983283005D7892 /* UIImage+MemoryCacheCost.m */; }; + 0E9EFA1121983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9EFA0921983283005D7892 /* UIImage+MemoryCacheCost.m */; }; + 0E9EFA1221983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9EFA0921983283005D7892 /* UIImage+MemoryCacheCost.m */; }; + 0E9EFA1321983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9EFA0921983283005D7892 /* UIImage+MemoryCacheCost.m */; }; + 0E9EFA1421983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9EFA0921983283005D7892 /* UIImage+MemoryCacheCost.m */; }; + 0E9EFA1521983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */ = {isa = PBXBuildFile; fileRef = 0E9EFA0921983283005D7892 /* UIImage+MemoryCacheCost.m */; }; 320224BB203979BA00E9F285 /* SDAnimatedImageRep.h in Headers */ = {isa = PBXBuildFile; fileRef = 320224B9203979BA00E9F285 /* SDAnimatedImageRep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 320224BC203979BA00E9F285 /* SDAnimatedImageRep.m in Sources */ = {isa = PBXBuildFile; fileRef = 320224BA203979BA00E9F285 /* SDAnimatedImageRep.m */; }; 321DB3612011D4D70015D2CB /* NSButton+WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 321DB35F2011D4D60015D2CB /* NSButton+WebCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1289,6 +1301,8 @@ /* Begin PBXFileReference section */ 00733A4C1BC487C000A5A117 /* SDWebImage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDWebImage.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 0E9EFA0821983283005D7892 /* UIImage+MemoryCacheCost.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+MemoryCacheCost.h"; sourceTree = ""; }; + 0E9EFA0921983283005D7892 /* UIImage+MemoryCacheCost.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+MemoryCacheCost.m"; sourceTree = ""; }; 320224B9203979BA00E9F285 /* SDAnimatedImageRep.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDAnimatedImageRep.h; sourceTree = ""; }; 320224BA203979BA00E9F285 /* SDAnimatedImageRep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDAnimatedImageRep.m; sourceTree = ""; }; 321DB35F2011D4D60015D2CB /* NSButton+WebCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSButton+WebCache.h"; path = "SDWebImage/NSButton+WebCache.h"; sourceTree = ""; }; @@ -1790,6 +1804,8 @@ 321E60BD1F38E91700405457 /* UIImage+ForceDecode.m */, AB615301192DA24600A2D8E9 /* UIView+WebCacheOperation.h */, AB615302192DA24600A2D8E9 /* UIView+WebCacheOperation.m */, + 0E9EFA0821983283005D7892 /* UIImage+MemoryCacheCost.h */, + 0E9EFA0921983283005D7892 /* UIImage+MemoryCacheCost.m */, ); name = Categories; sourceTree = ""; @@ -2018,6 +2034,7 @@ 4369C27A1D9807EC007E863A /* UIView+WebCache.h in Headers */, 80377DCC1F2F66A700F89830 /* lossless_common.h in Headers */, 321E60971F38E8ED00405457 /* SDWebImageImageIOCoder.h in Headers */, + 0E9EFA0D21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */, 43A918671D8308FE00B3925F /* SDImageCacheConfig.h in Headers */, 431739571CDFC8B70008FEB9 /* encode.h in Headers */, 00733A6F1BC4880E00A5A117 /* UIImage+WebP.h in Headers */, @@ -2109,6 +2126,7 @@ 4314D16D1D0E0E3B004B36C9 /* SDImageCache.h in Headers */, 4314D16F1D0E0E3B004B36C9 /* NSData+ImageContentType.h in Headers */, 80377C121F2F666300F89830 /* bit_reader_inl_utils.h in Headers */, + 0E9EFA0B21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */, 4314D1701D0E0E3B004B36C9 /* mux.h in Headers */, 321E60871F38E8C800405457 /* SDWebImageCoder.h in Headers */, 80377EA21F2F66D400F89830 /* vp8i_dec.h in Headers */, @@ -2175,6 +2193,7 @@ 431BB6DC1D06D2C1006A3455 /* UIButton+WebCache.h in Headers */, 431BB6E11D06D2C1006A3455 /* SDWebImage.h in Headers */, 80377E311F2F66A800F89830 /* yuv.h in Headers */, + 0E9EFA0E21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */, 80377ECA1F2F66D500F89830 /* common_dec.h in Headers */, 80377C771F2F666400F89830 /* thread_utils.h in Headers */, 80377E1F1F2F66A800F89830 /* mips_macro.h in Headers */, @@ -2264,6 +2283,7 @@ 4397D2C81D0DDD8C00BB2784 /* SDWebImageCompat.h in Headers */, 4397D2CB1D0DDD8C00BB2784 /* UIImageView+HighlightedWebCache.h in Headers */, 4397D2CC1D0DDD8C00BB2784 /* mux.h in Headers */, + 0E9EFA0F21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */, 80377C911F2F666400F89830 /* thread_utils.h in Headers */, 4397D2D01D0DDD8C00BB2784 /* SDWebImageDownloaderOperation.h in Headers */, 4397D2D11D0DDD8C00BB2784 /* decode.h in Headers */, @@ -2334,6 +2354,7 @@ 80377D871F2F66A700F89830 /* lossless_common.h in Headers */, 321E60961F38E8ED00405457 /* SDWebImageImageIOCoder.h in Headers */, 4A2CAE041AB4BB5400B6BC39 /* SDWebImage.h in Headers */, + 0E9EFA0C21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */, 431739511CDFC8B70008FEB9 /* format_constants.h in Headers */, 43A918661D8308FE00B3925F /* SDImageCacheConfig.h in Headers */, 323F8B701F38EF770092B609 /* delta_palettization_enc.h in Headers */, @@ -2429,6 +2450,7 @@ 80377D0B1F2F66A100F89830 /* mips_macro.h in Headers */, 5376131A155AD0D5005750A4 /* SDWebImageDownloader.h in Headers */, 4369C2771D9807EC007E863A /* UIView+WebCache.h in Headers */, + 0E9EFA0A21983283005D7892 /* UIImage+MemoryCacheCost.h in Headers */, 80377CEF1F2F66A100F89830 /* dsp.h in Headers */, 80377C011F2F665300F89830 /* filters_utils.h in Headers */, 5376131C155AD0D5005750A4 /* SDWebImageManager.h in Headers */, @@ -2698,6 +2720,7 @@ 323F8BBD1F38EF770092B609 /* predictor_enc.c in Sources */, 3290FA0D1FA478AF0047D20C /* SDWebImageFrame.m in Sources */, 80377DBD1F2F66A700F89830 /* dec.c in Sources */, + 0E9EFA1321983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */, 00733A561BC4880000A5A117 /* SDWebImageDownloaderOperation.m in Sources */, 80377DE71F2F66A700F89830 /* upsampling.c in Sources */, 321E60C71F38E91700405457 /* UIImage+ForceDecode.m in Sources */, @@ -2972,6 +2995,7 @@ 321E60B71F38E90100405457 /* SDWebImageWebPCoder.m in Sources */, 80377D5D1F2F66A700F89830 /* upsampling.c in Sources */, 80377D251F2F66A700F89830 /* argb.c in Sources */, + 0E9EFA1121983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */, 80377D281F2F66A700F89830 /* cost_mips32.c in Sources */, 323F8BF11F38EF770092B609 /* anim_encode.c in Sources */, 4314D1551D0E0E3B004B36C9 /* UIImageView+HighlightedWebCache.m in Sources */, @@ -3116,6 +3140,7 @@ 321E60BA1F38E90100405457 /* SDWebImageWebPCoder.m in Sources */, 80377E2C1F2F66A800F89830 /* upsampling.c in Sources */, 80377DF41F2F66A800F89830 /* argb.c in Sources */, + 0E9EFA1421983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */, 80377DF71F2F66A800F89830 /* cost_mips32.c in Sources */, 323F8BF41F38EF770092B609 /* anim_encode.c in Sources */, 80377C6E1F2F666400F89830 /* quant_levels_dec_utils.c in Sources */, @@ -3134,6 +3159,7 @@ 80377E511F2F66A800F89830 /* filters_mips_dsp_r2.c in Sources */, 80377E371F2F66A800F89830 /* argb_mips_dsp_r2.c in Sources */, 80377E471F2F66A800F89830 /* dec.c in Sources */, + 0E9EFA1521983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */, 80377C921F2F666400F89830 /* utils.c in Sources */, 4397D27E1D0DDD8C00BB2784 /* UIImage+GIF.m in Sources */, 321E60911F38E8C800405457 /* SDWebImageCoder.m in Sources */, @@ -3282,6 +3308,7 @@ 323F8BBC1F38EF770092B609 /* predictor_enc.c in Sources */, 3290FA0C1FA478AF0047D20C /* SDWebImageFrame.m in Sources */, 80377D781F2F66A700F89830 /* dec.c in Sources */, + 0E9EFA1221983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */, 80377DA21F2F66A700F89830 /* upsampling.c in Sources */, 80377C401F2F666300F89830 /* rescaler_utils.c in Sources */, 321E60C61F38E91700405457 /* UIImage+ForceDecode.m in Sources */, @@ -3430,6 +3457,7 @@ 323F8BBA1F38EF770092B609 /* predictor_enc.c in Sources */, 3290FA0A1FA478AF0047D20C /* SDWebImageFrame.m in Sources */, 80377CEE1F2F66A100F89830 /* dec.c in Sources */, + 0E9EFA1021983283005D7892 /* UIImage+MemoryCacheCost.m in Sources */, 80377D181F2F66A100F89830 /* upsampling.c in Sources */, 80377C0C1F2F665300F89830 /* rescaler_utils.c in Sources */, 321E60C41F38E91700405457 /* UIImage+ForceDecode.m in Sources */, diff --git a/dependencies/SDWebImage-master/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m b/dependencies/SDWebImage-master/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m index 99c1d033..7a00000d 100644 --- a/dependencies/SDWebImage-master/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m +++ b/dependencies/SDWebImage-master/SDWebImage/FLAnimatedImage/FLAnimatedImageView+WebCache.m @@ -15,6 +15,7 @@ #import "NSData+ImageContentType.h" #import "UIImageView+WebCache.h" #import "UIImage+MultiFormat.h" +#import "UIImage+MemoryCacheCost.h" static inline FLAnimatedImage * SDWebImageCreateFLAnimatedImage(FLAnimatedImageView *imageView, NSData *imageData) { if ([NSData sd_imageFormatForImageData:imageData] != SDImageFormatGIF) { @@ -22,7 +23,7 @@ } FLAnimatedImage *animatedImage; // Compatibility in 4.x for lower version FLAnimatedImage. - if ([FLAnimatedImage respondsToSelector:@selector(initWithAnimatedGIFData:optimalFrameCacheSize:predrawingEnabled:)]) { + if ([FLAnimatedImage instancesRespondToSelector:@selector(initWithAnimatedGIFData:optimalFrameCacheSize:predrawingEnabled:)]) { animatedImage = [[FLAnimatedImage alloc] initWithAnimatedGIFData:imageData optimalFrameCacheSize:imageView.sd_optimalFrameCacheSize predrawingEnabled:imageView.sd_predrawingEnabled]; } else { animatedImage = [[FLAnimatedImage alloc] initWithAnimatedGIFData:imageData]; @@ -30,6 +31,17 @@ return animatedImage; } +static inline NSUInteger SDWebImageMemoryCostFLAnimatedImage(FLAnimatedImage *animatedImage, UIImage *image) { + NSUInteger frameCacheSizeCurrent = animatedImage.frameCacheSizeCurrent; // [1...frame count], more suitable than raw frame count because FLAnimatedImage internal actually store a buffer size but not full frames (they called `window`) + NSUInteger pixelsPerFrame = animatedImage.size.width * animatedImage.size.height; // FLAnimatedImage does not support scale factor + NSUInteger animatedImageCost = frameCacheSizeCurrent * pixelsPerFrame; + + NSUInteger imageCost = image.size.height * image.size.width * image.scale * image.scale; // Same as normal cost calculation + imageCost = image.images ? (imageCost * image.images.count) : imageCost; + + return animatedImageCost + imageCost; +} + @implementation UIImage (FLAnimatedImage) - (FLAnimatedImage *)sd_FLAnimatedImage { @@ -113,6 +125,7 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDExternalCompletionBlock)completedBlock { + dispatch_group_t group = dispatch_group_create(); __weak typeof(self)weakSelf = self; [self sd_internalSetImageWithURL:url placeholderImage:placeholder @@ -121,45 +134,67 @@ - (void)sd_setImageWithURL:(nullable NSURL *)url setImageBlock:^(UIImage *image, NSData *imageData) { __strong typeof(weakSelf)strongSelf = weakSelf; if (!strongSelf) { + dispatch_group_leave(group); return; } // Step 1. Check memory cache (associate object) FLAnimatedImage *associatedAnimatedImage = image.sd_FLAnimatedImage; if (associatedAnimatedImage) { // Asscociated animated image exist - // FLAnimatedImage framework contains a bug that cause GIF been rotated if previous rendered image orientation is not Up. We have to call `setImage:` with non-nil image to reset the state. See `https://github.com/rs/SDWebImage/issues/2402` + // FLAnimatedImage framework contains a bug that cause GIF been rotated if previous rendered image orientation is not Up. We have to call `setImage:` with non-nil image to reset the state. See `https://github.com/SDWebImage/SDWebImage/issues/2402` strongSelf.image = associatedAnimatedImage.posterImage; strongSelf.animatedImage = associatedAnimatedImage; + dispatch_group_leave(group); return; } // Step 2. Check if original compressed image data is "GIF" BOOL isGIF = (image.sd_imageFormat == SDImageFormatGIF || [NSData sd_imageFormatForImageData:imageData] == SDImageFormatGIF); - if (!isGIF) { + // Check if placeholder, which does not trigger a backup disk cache query + BOOL isPlaceholder = (image == placeholder); + if (!isGIF || isPlaceholder) { strongSelf.image = image; strongSelf.animatedImage = nil; + dispatch_group_leave(group); return; } - // Step 3. Check if data exist or query disk cache - if (!imageData) { + __weak typeof(strongSelf) wweakSelf = strongSelf; + // Hack, mark we need should use dispatch group notify for completedBlock + objc_setAssociatedObject(group, &SDWebImageInternalSetImageGroupKey, @(YES), OBJC_ASSOCIATION_RETAIN_NONATOMIC); + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + __strong typeof(wweakSelf) sstrongSelf = wweakSelf; + if (!sstrongSelf || ![url isEqual:sstrongSelf.sd_imageURL]) { return ; } + // Step 3. Check if data exist or query disk cache NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url]; - imageData = [[SDImageCache sharedImageCache] diskImageDataForKey:key]; - } - // Step 4. Create FLAnimatedImage - FLAnimatedImage *animatedImage = SDWebImageCreateFLAnimatedImage(strongSelf, imageData); - // Step 5. Set animatedImage or normal image - if (animatedImage) { - if (strongSelf.sd_cacheFLAnimatedImage) { - image.sd_FLAnimatedImage = animatedImage; + __block NSData *gifData = imageData; + if (!gifData) { + gifData = [[SDImageCache sharedImageCache] diskImageDataForKey:key]; } - strongSelf.image = animatedImage.posterImage; - strongSelf.animatedImage = animatedImage; - } else { - strongSelf.image = image; - strongSelf.animatedImage = nil; - } + // Step 4. Create FLAnimatedImage + FLAnimatedImage *animatedImage = SDWebImageCreateFLAnimatedImage(sstrongSelf, gifData); + dispatch_async(dispatch_get_main_queue(), ^{ + if (![url isEqual:sstrongSelf.sd_imageURL]) { return ; } + // Step 5. Set animatedImage or normal image + if (animatedImage) { + if (sstrongSelf.sd_cacheFLAnimatedImage && SDImageCache.sharedImageCache.config.shouldCacheImagesInMemory) { + image.sd_FLAnimatedImage = animatedImage; + image.sd_memoryCost = SDWebImageMemoryCostFLAnimatedImage(animatedImage, image); + // Update the memory cache + [SDImageCache.sharedImageCache removeImageForKey:key fromDisk:NO withCompletion:nil]; + [SDImageCache.sharedImageCache storeImage:image forKey:key toDisk:NO completion:nil]; + } + sstrongSelf.image = animatedImage.posterImage; + sstrongSelf.animatedImage = animatedImage; + } else { + sstrongSelf.image = image; + sstrongSelf.animatedImage = nil; + } + dispatch_group_leave(group); + }); + }); } progress:progressBlock - completed:completedBlock]; + completed:completedBlock + context:@{SDWebImageInternalSetImageGroupKey: group}]; } @end diff --git a/dependencies/SDWebImage-master/SDWebImage/SDImageCache.m b/dependencies/SDWebImage-master/SDWebImage/SDImageCache.m index 75d44f02..015f6ac6 100644 --- a/dependencies/SDWebImage-master/SDWebImage/SDImageCache.m +++ b/dependencies/SDWebImage-master/SDWebImage/SDImageCache.m @@ -9,19 +9,14 @@ #import "SDImageCache.h" #import #import "NSImage+WebCache.h" +#import "UIImage+MemoryCacheCost.h" #import "SDWebImageCodersManager.h" +#define SD_MAX_FILE_EXTENSION_LENGTH (NAME_MAX - CC_MD5_DIGEST_LENGTH * 2 - 1) + #define LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); #define UNLOCK(lock) dispatch_semaphore_signal(lock); -FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { -#if SD_MAC - return image.size.height * image.size.width; -#elif SD_UIKIT || SD_WATCH - return image.size.height * image.size.width * image.scale * image.scale; -#endif -} - // A memory cache which auto purge the cache on memory warning and support weak cache. @interface SDMemoryCache : NSCache @@ -80,7 +75,9 @@ - (void)setObject:(id)obj forKey:(id)key cost:(NSUInteger)g { if (key && obj) { // Store weak cache LOCK(self.weakCacheLock); - [self.weakCache setObject:obj forKey:key]; + // Do the real copy of the key and only let NSMapTable manage the key's lifetime + // Fixes issue #2507 https://github.com/SDWebImage/SDWebImage/issues/2507 + [self.weakCache setObject:obj forKey:[[key mutableCopy] copy]]; UNLOCK(self.weakCacheLock); } } @@ -99,7 +96,7 @@ - (id)objectForKey:(id)key { // Sync cache NSUInteger cost = 0; if ([obj isKindOfClass:[UIImage class]]) { - cost = SDCacheCostForImage(obj); + cost = [(UIImage *)obj sd_memoryCost]; } [super setObject:obj forKey:key cost:cost]; } @@ -253,6 +250,10 @@ - (nullable NSString *)cachedFileNameForKey:(nullable NSString *)key { CC_MD5(str, (CC_LONG)strlen(str), r); NSURL *keyURL = [NSURL URLWithString:key]; NSString *ext = keyURL ? keyURL.pathExtension : key.pathExtension; + // File system has file name length limit, we need to check if ext is too long, we don't add it to the filename + if (ext.length > SD_MAX_FILE_EXTENSION_LENGTH) { + ext = nil; + } NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%@", r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15], ext.length == 0 ? @"" : [NSString stringWithFormat:@".%@", ext]]; @@ -292,7 +293,7 @@ - (void)storeImage:(nullable UIImage *)image } // if memory cache is enabled if (self.config.shouldCacheImagesInMemory) { - NSUInteger cost = SDCacheCostForImage(image); + NSUInteger cost = image.sd_memoryCost; [self.memCache setObject:image forKey:key cost:cost]; } @@ -390,7 +391,7 @@ - (BOOL)_diskImageDataExistsWithKey:(nullable NSString *)key { } BOOL exists = [self.fileManager fileExistsAtPath:[self defaultCachePathForKey:key]]; - // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // fallback because of https://github.com/SDWebImage/SDWebImage/pull/976 that added the extension to the disk file name // checking the key with and without the extension if (!exists) { exists = [self.fileManager fileExistsAtPath:[self defaultCachePathForKey:key].stringByDeletingPathExtension]; @@ -418,7 +419,7 @@ - (nullable UIImage *)imageFromMemoryCacheForKey:(nullable NSString *)key { - (nullable UIImage *)imageFromDiskCacheForKey:(nullable NSString *)key { UIImage *diskImage = [self diskImageForKey:key]; if (diskImage && self.config.shouldCacheImagesInMemory) { - NSUInteger cost = SDCacheCostForImage(diskImage); + NSUInteger cost = diskImage.sd_memoryCost; [self.memCache setObject:diskImage forKey:key cost:cost]; } @@ -444,7 +445,7 @@ - (nullable NSData *)diskImageDataBySearchingAllPathsForKey:(nullable NSString * return data; } - // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // fallback because of https://github.com/SDWebImage/SDWebImage/pull/976 that added the extension to the disk file name // checking the key with and without the extension data = [NSData dataWithContentsOfFile:defaultPath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil]; if (data) { @@ -459,7 +460,7 @@ - (nullable NSData *)diskImageDataBySearchingAllPathsForKey:(nullable NSString * return imageData; } - // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name + // fallback because of https://github.com/SDWebImage/SDWebImage/pull/976 that added the extension to the disk file name // checking the key with and without the extension imageData = [NSData dataWithContentsOfFile:filePath.stringByDeletingPathExtension options:self.config.diskCacheReadingOptions error:nil]; if (imageData) { @@ -529,16 +530,17 @@ - (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key opt @autoreleasepool { NSData *diskData = [self diskImageDataBySearchingAllPathsForKey:key]; UIImage *diskImage; - SDImageCacheType cacheType = SDImageCacheTypeDisk; + SDImageCacheType cacheType = SDImageCacheTypeNone; if (image) { // the image is from in-memory cache diskImage = image; cacheType = SDImageCacheTypeMemory; } else if (diskData) { + cacheType = SDImageCacheTypeDisk; // decode image data only if in-memory cache missed diskImage = [self diskImageForKey:key data:diskData options:options]; if (diskImage && self.config.shouldCacheImagesInMemory) { - NSUInteger cost = SDCacheCostForImage(diskImage); + NSUInteger cost = diskImage.sd_memoryCost; [self.memCache setObject:diskImage forKey:key cost:cost]; } } diff --git a/dependencies/SDWebImage-master/SDWebImage/SDWebImageCompat.m b/dependencies/SDWebImage-master/SDWebImage/SDWebImageCompat.m index daee7fc9..ffde1d22 100644 --- a/dependencies/SDWebImage-master/SDWebImage/SDWebImageCompat.m +++ b/dependencies/SDWebImage-master/SDWebImage/SDWebImageCompat.m @@ -56,10 +56,12 @@ scale = 3.0; } } - - UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; - scaledImage.sd_imageFormat = image.sd_imageFormat; - image = scaledImage; + + if (scale != image.scale) { + UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; + scaledImage.sd_imageFormat = image.sd_imageFormat; + image = scaledImage; + } } return image; } diff --git a/dependencies/SDWebImage-master/SDWebImage/SDWebImageDownloader.m b/dependencies/SDWebImage-master/SDWebImage/SDWebImageDownloader.m index c0a4b331..30cadca4 100644 --- a/dependencies/SDWebImage-master/SDWebImage/SDWebImageDownloader.m +++ b/dependencies/SDWebImage-master/SDWebImage/SDWebImageDownloader.m @@ -289,8 +289,8 @@ - (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url LOCK(self.operationsLock); NSOperation *operation = [self.URLOperations objectForKey:url]; - // There is a case that the operation may be marked as finished, but not been removed from `self.URLOperations`. - if (!operation || operation.isFinished) { + // There is a case that the operation may be marked as finished or cancelled, but not been removed from `self.URLOperations`. + if (!operation || operation.isFinished || operation.isCancelled) { operation = [self createDownloaderOperationWithUrl:url options:options]; __weak typeof(self) wself = self; operation.completionBlock = ^{ @@ -307,6 +307,15 @@ - (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url // `addOperation:` does not synchronously execute the `operation.completionBlock` so this will not cause deadlock. [self.downloadQueue addOperation:operation]; } + else if (!operation.isExecuting) { + if (options & SDWebImageDownloaderHighPriority) { + operation.queuePriority = NSOperationQueuePriorityHigh; + } else if (options & SDWebImageDownloaderLowPriority) { + operation.queuePriority = NSOperationQueuePriorityLow; + } else { + operation.queuePriority = NSOperationQueuePriorityNormal; + } + } UNLOCK(self.operationsLock); id downloadOperationCancelToken = [operation addHandlersForProgress:progressBlock completed:completedBlock]; diff --git a/dependencies/SDWebImage-master/SDWebImage/SDWebImageDownloaderOperation.m b/dependencies/SDWebImage-master/SDWebImage/SDWebImageDownloaderOperation.m index e0a68976..ae369997 100644 --- a/dependencies/SDWebImage-master/SDWebImage/SDWebImageDownloaderOperation.m +++ b/dependencies/SDWebImage-master/SDWebImage/SDWebImageDownloaderOperation.m @@ -82,6 +82,9 @@ - (nonnull instancetype)initWithRequest:(nullable NSURLRequest *)request _unownedSession = session; _callbacksLock = dispatch_semaphore_create(1); _coderQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderOperationCoderQueue", DISPATCH_QUEUE_SERIAL); +#if SD_UIKIT + _backgroundTaskId = UIBackgroundTaskInvalid; +#endif } return self; } @@ -135,14 +138,7 @@ - (void)start { __weak __typeof__ (self) wself = self; UIApplication * app = [UIApplicationClass performSelector:@selector(sharedApplication)]; self.backgroundTaskId = [app beginBackgroundTaskWithExpirationHandler:^{ - __strong __typeof (wself) sself = wself; - - if (sself) { - [sself cancel]; - - [app endBackgroundTask:sself.backgroundTaskId]; - sself.backgroundTaskId = UIBackgroundTaskInvalid; - } + [wself cancel]; }]; } #endif @@ -197,27 +193,15 @@ - (void)start { for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { progressBlock(0, NSURLResponseUnknownLength, self.request.URL); } - __weak typeof(self) weakSelf = self; + __block typeof(self) strongSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStartNotification object:weakSelf]; + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStartNotification object:strongSelf]; }); } else { [self callCompletionBlocksWithError:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorUnknown userInfo:@{NSLocalizedDescriptionKey : @"Task can't be initialized"}]]; [self done]; return; } - -#if SD_UIKIT - Class UIApplicationClass = NSClassFromString(@"UIApplication"); - if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) { - return; - } - if (self.backgroundTaskId != UIBackgroundTaskInvalid) { - UIApplication * app = [UIApplication performSelector:@selector(sharedApplication)]; - [app endBackgroundTask:self.backgroundTaskId]; - self.backgroundTaskId = UIBackgroundTaskInvalid; - } -#endif } - (void)cancel { @@ -232,9 +216,9 @@ - (void)cancelInternal { if (self.dataTask) { [self.dataTask cancel]; - __weak typeof(self) weakSelf = self; + __block typeof(self) strongSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:weakSelf]; + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:strongSelf]; }); // As we cancelled the task, its callback won't be called and thus won't @@ -256,11 +240,23 @@ - (void)reset { LOCK(self.callbacksLock); [self.callbackBlocks removeAllObjects]; UNLOCK(self.callbacksLock); - self.dataTask = nil; - if (self.ownedSession) { - [self.ownedSession invalidateAndCancel]; - self.ownedSession = nil; + @synchronized (self) { + self.dataTask = nil; + + if (self.ownedSession) { + [self.ownedSession invalidateAndCancel]; + self.ownedSession = nil; + } + +#if SD_UIKIT + if (self.backgroundTaskId != UIBackgroundTaskInvalid) { + // If backgroundTaskId != UIBackgroundTaskInvalid, sharedApplication is always exist + UIApplication * app = [UIApplication performSelector:@selector(sharedApplication)]; + [app endBackgroundTask:self.backgroundTaskId]; + self.backgroundTaskId = UIBackgroundTaskInvalid; + } +#endif } } @@ -307,10 +303,9 @@ - (void)URLSession:(NSURLSession *)session // Status code invalid and marked as cancelled. Do not call `[self.dataTask cancel]` which may mass up URLSession life cycle disposition = NSURLSessionResponseCancel; } - - __weak typeof(self) weakSelf = self; + __block typeof(self) strongSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadReceiveResponseNotification object:weakSelf]; + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadReceiveResponseNotification object:strongSelf]; }); if (completionHandler) { @@ -388,11 +383,11 @@ - (void)URLSession:(NSURLSession *)session - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { @synchronized(self) { self.dataTask = nil; - __weak typeof(self) weakSelf = self; + __block typeof(self) strongSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:weakSelf]; + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:strongSelf]; if (!error) { - [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadFinishNotification object:weakSelf]; + [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadFinishNotification object:strongSelf]; } }); } @@ -423,19 +418,8 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didComp NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:self.request.URL]; image = [self scaledImageForKey:key image:image]; - BOOL shouldDecode = YES; - // Do not force decoding animated GIFs and WebPs - if (image.images) { - shouldDecode = NO; - } else { -#ifdef SD_WEBP - SDImageFormat imageFormat = [NSData sd_imageFormatForImageData:imageData]; - if (imageFormat == SDImageFormatWebP) { - shouldDecode = NO; - } -#endif - } - + // Do not force decoding animated images + BOOL shouldDecode = !image.images; if (shouldDecode) { if (self.shouldDecompressImages) { BOOL shouldScaleDown = self.options & SDWebImageDownloaderScaleDownLargeImages; diff --git a/dependencies/SDWebImage-master/SDWebImage/SDWebImageWebPCoder.m b/dependencies/SDWebImage-master/SDWebImage/SDWebImageWebPCoder.m index 7971d231..d1811e54 100644 --- a/dependencies/SDWebImage-master/SDWebImage/SDWebImageWebPCoder.m +++ b/dependencies/SDWebImage-master/SDWebImage/SDWebImageWebPCoder.m @@ -12,6 +12,7 @@ #import "SDWebImageCoderHelper.h" #import "NSImage+WebCache.h" #import "UIImage+MultiFormat.h" +#import "SDWebImageImageIOCoder.h" #if __has_include() && __has_include() && __has_include() && __has_include() #import #import @@ -25,6 +26,7 @@ #endif #import + @implementation SDWebImageWebPCoder { WebPIDecoder *_idec; } @@ -69,6 +71,18 @@ - (UIImage *)decodedImageWithData:(NSData *)data { } uint32_t flags = WebPDemuxGetI(demuxer, WEBP_FF_FORMAT_FLAGS); + + CGColorSpaceRef colorSpace = [self sd_colorSpaceWithDemuxer:demuxer]; + + if (!(flags & ANIMATION_FLAG)) { + // for static single webp image + UIImage *staticImage = [self sd_rawWebpImageWithData:webpData colorSpace:colorSpace]; + WebPDemuxDelete(demuxer); + CGColorSpaceRelease(colorSpace); + staticImage.sd_imageFormat = SDImageFormatWebP; + return staticImage; + } + int loopCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT); int canvasWidth = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH); int canvasHeight = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT); @@ -81,41 +95,21 @@ - (UIImage *)decodedImageWithData:(NSData *)data { // RGBA8888 bitmapInfo = kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast; } + CGContextRef canvas = CGBitmapContextCreate(NULL, canvasWidth, canvasHeight, 8, 0, SDCGColorSpaceGetDeviceRGB(), bitmapInfo); if (!canvas) { WebPDemuxDelete(demuxer); + CGColorSpaceRelease(colorSpace); return nil; } - if (!(flags & ANIMATION_FLAG)) { - // for static single webp image - UIImage *staticImage = [self sd_rawWebpImageWithData:webpData]; - if (staticImage) { - // draw on CGBitmapContext can reduce memory usage - CGImageRef imageRef = staticImage.CGImage; - size_t width = CGImageGetWidth(imageRef); - size_t height = CGImageGetHeight(imageRef); - CGContextDrawImage(canvas, CGRectMake(0, 0, width, height), imageRef); - CGImageRef newImageRef = CGBitmapContextCreateImage(canvas); -#if SD_UIKIT || SD_WATCH - staticImage = [[UIImage alloc] initWithCGImage:newImageRef]; -#else - staticImage = [[UIImage alloc] initWithCGImage:newImageRef size:NSZeroSize]; -#endif - CGImageRelease(newImageRef); - } - WebPDemuxDelete(demuxer); - CGContextRelease(canvas); - staticImage.sd_imageFormat = SDImageFormatWebP; - return staticImage; - } - // for animated webp image WebPIterator iter; if (!WebPDemuxGetFrame(demuxer, 1, &iter)) { WebPDemuxReleaseIterator(&iter); WebPDemuxDelete(demuxer); CGContextRelease(canvas); + CGColorSpaceRelease(colorSpace); return nil; } @@ -123,7 +117,7 @@ - (UIImage *)decodedImageWithData:(NSData *)data { do { @autoreleasepool { - UIImage *image = [self sd_drawnWebpImageWithCanvas:canvas iterator:iter]; + UIImage *image = [self sd_drawnWebpImageWithCanvas:canvas iterator:iter colorSpace:colorSpace]; if (!image) { continue; } @@ -143,6 +137,7 @@ - (UIImage *)decodedImageWithData:(NSData *)data { WebPDemuxReleaseIterator(&iter); WebPDemuxDelete(demuxer); CGContextRelease(canvas); + CGColorSpaceRelease(colorSpace); UIImage *animatedImage = [SDWebImageCoderHelper animatedImageWithFrames:frames]; animatedImage.sd_imageLoopCount = loopCount; @@ -235,12 +230,14 @@ - (UIImage *)incrementallyDecodedImageWithData:(NSData *)data finished:(BOOL)fin - (UIImage *)decompressedImageWithImage:(UIImage *)image data:(NSData *__autoreleasing _Nullable *)data options:(nullable NSDictionary*)optionsDict { - // WebP do not decompress - return image; + // Decompress can help pre-draw the image and transfer the backing store to render process. + // Well, it can reduce the `App process memory usage` from Xcode, because the backing store is in `Other process` (render process). But it does not help for total memory usage for device. + // This logic is actually the same as Image/IO, reuse the code. The refactory has already done in 5.x + return [[SDWebImageImageIOCoder sharedCoder] decompressedImageWithImage:image data:data options:optionsDict]; } -- (nullable UIImage *)sd_drawnWebpImageWithCanvas:(CGContextRef)canvas iterator:(WebPIterator)iter { - UIImage *image = [self sd_rawWebpImageWithData:iter.fragment]; +- (nullable UIImage *)sd_drawnWebpImageWithCanvas:(CGContextRef)canvas iterator:(WebPIterator)iter colorSpace:(nonnull CGColorSpaceRef)colorSpaceRef { + UIImage *image = [self sd_rawWebpImageWithData:iter.fragment colorSpace:colorSpaceRef]; if (!image) { return nil; } @@ -275,7 +272,7 @@ - (nullable UIImage *)sd_drawnWebpImageWithCanvas:(CGContextRef)canvas iterator: return image; } -- (nullable UIImage *)sd_rawWebpImageWithData:(WebPData)webpData { +- (nullable UIImage *)sd_rawWebpImageWithData:(WebPData)webpData colorSpace:(nonnull CGColorSpaceRef)colorSpaceRef { WebPDecoderConfig config; if (!WebPInitDecoderConfig(&config)) { return nil; @@ -303,7 +300,6 @@ - (nullable UIImage *)sd_rawWebpImageWithData:(WebPData)webpData { // Construct a UIImage from the decoded RGBA value array CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, config.output.u.RGBA.rgba, config.output.u.RGBA.size, FreeImageData); - CGColorSpaceRef colorSpaceRef = SDCGColorSpaceGetDeviceRGB(); CGBitmapInfo bitmapInfo; // `CGBitmapContextCreate` does not support RGB888 on iOS. Where `CGImageCreate` supports. if (!config.input.has_alpha) { @@ -329,6 +325,32 @@ - (nullable UIImage *)sd_rawWebpImageWithData:(WebPData)webpData { return image; } +// Create and return the correct colorspace by checking the ICC Profile +- (nonnull CGColorSpaceRef)sd_colorSpaceWithDemuxer:(nonnull WebPDemuxer *)demuxer CF_RETURNS_RETAINED { + // WebP contains ICC Profile should use the desired colorspace, instead of default device colorspace + // See: https://developers.google.com/speed/webp/docs/riff_container#color_profile + + CGColorSpaceRef colorSpaceRef = NULL; + uint32_t flags = WebPDemuxGetI(demuxer, WEBP_FF_FORMAT_FLAGS); + + if (flags & ICCP_FLAG) { + WebPChunkIterator chunk_iter; + int result = WebPDemuxGetChunk(demuxer, "ICCP", 1, &chunk_iter); + if (result) { + NSData *profileData = [NSData dataWithBytesNoCopy:(void *)chunk_iter.chunk.bytes length:chunk_iter.chunk.size freeWhenDone:NO]; + colorSpaceRef = CGColorSpaceCreateWithICCProfile((__bridge CFDataRef)profileData); + WebPDemuxReleaseChunkIterator(&chunk_iter); + } + } + + if (!colorSpaceRef) { + colorSpaceRef = SDCGColorSpaceGetDeviceRGB(); + CGColorSpaceRetain(colorSpaceRef); + } + + return colorSpaceRef; +} + #pragma mark - Encode - (BOOL)canEncodeToFormat:(SDImageFormat)format { return (format == SDImageFormatWebP); diff --git a/dependencies/SDWebImage-master/SDWebImage/UIView+WebCache.h b/dependencies/SDWebImage-master/SDWebImage/UIView+WebCache.h index 026f1b3c..85cb2c6d 100644 --- a/dependencies/SDWebImage-master/SDWebImage/UIView+WebCache.h +++ b/dependencies/SDWebImage-master/SDWebImage/UIView+WebCache.h @@ -13,7 +13,7 @@ /** A Dispatch group to maintain setImageBlock and completionBlock. This key should be used only internally and may be changed in the future. (dispatch_group_t) */ -FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageInternalSetImageGroupKey __deprecated_msg("Key Deprecated. Does nothing. This key should be used only internally"); +FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageInternalSetImageGroupKey; /** A SDWebImageManager instance to control the image download and cache process using in UIImageView+WebCache category and likes. If not provided, use the shared manager (SDWebImageManager) */ diff --git a/dependencies/SDWebImage-master/SDWebImage/UIView+WebCache.m b/dependencies/SDWebImage-master/SDWebImage/UIView+WebCache.m index 88def759..112a5e1d 100644 --- a/dependencies/SDWebImage-master/SDWebImage/UIView+WebCache.m +++ b/dependencies/SDWebImage-master/SDWebImage/UIView+WebCache.m @@ -64,7 +64,11 @@ - (void)sd_internalSetImageWithURL:(nullable NSURL *)url [self sd_cancelImageLoadOperationWithKey:validOperationKey]; objc_setAssociatedObject(self, &imageURLKey, url, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + dispatch_group_t group = context[SDWebImageInternalSetImageGroupKey]; if (!(options & SDWebImageDelayPlaceholder)) { + if (group) { + dispatch_group_enter(group); + } dispatch_main_async_safe(^{ [self sd_setImage:placeholder imageData:nil basedOnClassOrViaCustomSetImageBlock:setImageBlock]; }); @@ -147,12 +151,25 @@ - (void)sd_internalSetImageWithURL:(nullable NSURL *)url } #endif dispatch_main_async_safe(^{ + if (group) { + dispatch_group_enter(group); + } #if SD_UIKIT || SD_MAC [sself sd_setImage:targetImage imageData:targetData basedOnClassOrViaCustomSetImageBlock:setImageBlock transition:transition cacheType:cacheType imageURL:imageURL]; #else [sself sd_setImage:targetImage imageData:targetData basedOnClassOrViaCustomSetImageBlock:setImageBlock]; #endif - callCompletedBlockClojure(); + if (group) { + // compatible code for FLAnimatedImage, because we assume completedBlock called after image was set. This will be removed in 5.x + BOOL shouldUseGroup = [objc_getAssociatedObject(group, &SDWebImageInternalSetImageGroupKey) boolValue]; + if (shouldUseGroup) { + dispatch_group_notify(group, dispatch_get_main_queue(), callCompletedBlockClojure); + } else { + callCompletedBlockClojure(); + } + } else { + callCompletedBlockClojure(); + } }); }]; [self sd_setImageLoadOperation:operation forKey:validOperationKey]; diff --git a/dependencies/SDWebImage-master/Tests/SDWebImage Tests.xcodeproj/project.pbxproj b/dependencies/SDWebImage-master/Tests/SDWebImage Tests.xcodeproj/project.pbxproj index 8013ef4d..5330f6af 100644 --- a/dependencies/SDWebImage-master/Tests/SDWebImage Tests.xcodeproj/project.pbxproj +++ b/dependencies/SDWebImage-master/Tests/SDWebImage Tests.xcodeproj/project.pbxproj @@ -159,7 +159,6 @@ DA248D50195472AA00390AB0 /* Frameworks */, DA248D51195472AA00390AB0 /* Resources */, C86216497B5A0BA9501E2C07 /* [CP] Embed Pods Frameworks */, - 85E5D3885A03BFC23B050908 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -232,21 +231,6 @@ 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; }; - 85E5D3885A03BFC23B050908 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; C86216497B5A0BA9501E2C07 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/dependencies/SDWebImage-master/Tests/Tests/SDImageCacheTests.m b/dependencies/SDWebImage-master/Tests/Tests/SDImageCacheTests.m index 0cfb17a0..cdf87407 100644 --- a/dependencies/SDWebImage-master/Tests/Tests/SDImageCacheTests.m +++ b/dependencies/SDWebImage-master/Tests/Tests/SDImageCacheTests.m @@ -227,6 +227,20 @@ - (void)test35CachePathForKeyWithDotButNoExtension { expect([cachePath pathExtension]).to.equal(@""); } +- (void)test36CachePathForKeyWithURLQueryParams { + NSString *urlString = @"https://imggen.alicdn.com/3b11cea896a9438329d85abfb07b30a8.jpg?aid=tanx&tid=1166&m=%7B%22img_url%22%3A%22https%3A%2F%2Fgma.alicdn.com%2Fbao%2Fuploaded%2Fi4%2F1695306010722305097%2FTB2S2KjkHtlpuFjSspoXXbcDpXa_%21%210-saturn_solar.jpg_sum.jpg%22%2C%22title%22%3A%22%E6%A4%8D%E7%89%A9%E8%94%B7%E8%96%87%E7%8E%AB%E7%91%B0%E8%8A%B1%22%2C%22promot_name%22%3A%22%22%2C%22itemid%22%3A%22546038044448%22%7D&e=cb88dab197bfaa19804f6ec796ca906dab536b88fe6d4475795c7ee661a7ede1&size=640x246"; + NSString *cachePath = [[SDImageCache sharedImageCache] cachePathForKey:urlString inPath:@""]; + expect(cachePath).toNot.beNil(); + expect([cachePath pathExtension]).to.equal(@"jpg"); +} + +- (void)test37CachePathForKeyWithTooLongExtension { + NSString *urlString = @"https://imggen.alicdn.com/3b11cea896a9438329d85abfb07b30a8.jpgasaaaaaaaaaaaaaaaaaaaajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjaaaaaaaaaaaaaaaaajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj"; + NSString *cachePath = [[SDImageCache sharedImageCache] cachePathForKey:urlString inPath:@""]; + expect(cachePath).toNot.beNil(); + expect([cachePath pathExtension]).to.equal(@""); +} + - (void)test40InsertionOfImageData { XCTestExpectation *expectation = [self expectationWithDescription:@"Insertion of image data works"];