Browse Source

update SDWebimage in order to fix images not appearing on iOS14

cyberta 4 years ago
parent
commit
f66d9bd51a
67 changed files with 1510 additions and 1224 deletions
  1. 2 2
      Podfile
  2. 7 7
      Podfile.lock
  3. 7 7
      Pods/Manifest.lock
  4. 938 927
      Pods/Pods.xcodeproj/project.pbxproj
  5. 1 1
      Pods/SDWebImage/LICENSE
  6. 2 2
      Pods/SDWebImage/README.md
  7. 1 1
      Pods/SDWebImage/SDWebImage/Core/NSData+ImageContentType.h
  8. 4 9
      Pods/SDWebImage/SDWebImage/Core/NSData+ImageContentType.m
  9. 2 2
      Pods/SDWebImage/SDWebImage/Core/SDAnimatedImage.h
  10. 62 3
      Pods/SDWebImage/SDWebImage/Core/SDAnimatedImage.m
  11. 6 6
      Pods/SDWebImage/SDWebImage/Core/SDAnimatedImagePlayer.h
  12. 4 3
      Pods/SDWebImage/SDWebImage/Core/SDAnimatedImagePlayer.m
  13. 18 5
      Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageRep.m
  14. 10 2
      Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView.m
  15. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDDiskCache.m
  16. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.m
  17. 23 0
      Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.h
  18. 98 0
      Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.m
  19. 16 6
      Pods/SDWebImage/SDWebImage/Core/SDImageCache.h
  20. 25 16
      Pods/SDWebImage/SDWebImage/Core/SDImageCache.m
  21. 4 4
      Pods/SDWebImage/SDWebImage/Core/SDImageCacheConfig.h
  22. 7 7
      Pods/SDWebImage/SDWebImage/Core/SDImageCacheDefine.h
  23. 4 4
      Pods/SDWebImage/SDWebImage/Core/SDImageCoder.h
  24. 4 3
      Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.h
  25. 10 14
      Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.m
  26. 1 0
      Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.h
  27. 6 69
      Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.m
  28. 2 2
      Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.h
  29. 39 8
      Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.m
  30. 3 28
      Pods/SDWebImage/SDWebImage/Core/SDImageIOCoder.m
  31. 5 5
      Pods/SDWebImage/SDWebImage/Core/SDImageLoader.h
  32. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDImageLoadersManager.h
  33. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDImageTransformer.h
  34. 10 9
      Pods/SDWebImage/SDWebImage/Core/SDWebImageDefine.h
  35. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloader.h
  36. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.h
  37. 2 2
      Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.h
  38. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.h
  39. 2 2
      Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.m
  40. 2 2
      Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.h
  41. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.m
  42. 2 2
      Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderResponseModifier.h
  43. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDWebImageError.h
  44. 4 4
      Pods/SDWebImage/SDWebImage/Core/SDWebImageManager.h
  45. 1 1
      Pods/SDWebImage/SDWebImage/Core/SDWebImageManager.m
  46. 3 3
      Pods/SDWebImage/SDWebImage/Core/SDWebImagePrefetcher.h
  47. 30 2
      Pods/SDWebImage/SDWebImage/Core/SDWebImageTransition.h
  48. 29 0
      Pods/SDWebImage/SDWebImage/Core/SDWebImageTransition.m
  49. 1 1
      Pods/SDWebImage/SDWebImage/Core/UIImage+GIF.h
  50. 1 1
      Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.h
  51. 1 0
      Pods/SDWebImage/SDWebImage/Core/UIImage+MultiFormat.h
  52. 1 1
      Pods/SDWebImage/SDWebImage/Core/UIImage+Transform.h
  53. 6 5
      Pods/SDWebImage/SDWebImage/Core/UIView+WebCache.h
  54. 50 5
      Pods/SDWebImage/SDWebImage/Core/UIView+WebCache.m
  55. 1 1
      Pods/SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.h
  56. 1 1
      Pods/SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.m
  57. 0 25
      Pods/SDWebImage/SDWebImage/Private/SDImageHEICCoderInternal.h
  58. 10 0
      Pods/SDWebImage/SDWebImage/Private/SDImageIOAnimatedCoderInternal.h
  59. 1 0
      Pods/SDWebImage/WebImage/SDWebImage.h
  60. 1 1
      Pods/Target Support Files/Pods-deltachat-ios-DcShare/Pods-deltachat-ios-DcShare-acknowledgements.markdown
  61. 1 1
      Pods/Target Support Files/Pods-deltachat-ios-DcShare/Pods-deltachat-ios-DcShare-acknowledgements.plist
  62. 1 1
      Pods/Target Support Files/Pods-deltachat-ios/Pods-deltachat-ios-acknowledgements.markdown
  63. 1 1
      Pods/Target Support Files/Pods-deltachat-ios/Pods-deltachat-ios-acknowledgements.plist
  64. 1 1
      Pods/Target Support Files/SDWebImage/SDWebImage-Info.plist
  65. 1 0
      Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h
  66. 13 0
      Pods/Target Support Files/SDWebImage/SDWebImage.debug.xcconfig
  67. 13 0
      Pods/Target Support Files/SDWebImage/SDWebImage.release.xcconfig

+ 2 - 2
Podfile

@@ -15,7 +15,7 @@ target 'deltachat-ios' do
   pod 'DBDebugToolkit'
   pod 'InputBarAccessoryView'
   pod 'SCSiriWaveformView'
-  pod 'SDWebImage', '~> 5.0'
+  pod 'SDWebImage', '~> 5.9.1'
   target 'deltachat-iosTests' do
     inherit! :search_paths
     # Pods for testing
@@ -29,7 +29,7 @@ target 'DcShare' do
   # ignore all warnings from all dependencies
   inhibit_all_warnings!
 
-  pod 'SDWebImage', '~> 5.0'
+  pod 'SDWebImage', '~> 5.9.1'
 end
 
 end

+ 7 - 7
Podfile.lock

@@ -5,9 +5,9 @@ PODS:
   - InputBarAccessoryView/Core (4.3.1)
   - ReachabilitySwift (4.3.1)
   - SCSiriWaveformView (1.1.1)
-  - SDWebImage (5.8.0):
-    - SDWebImage/Core (= 5.8.0)
-  - SDWebImage/Core (5.8.0)
+  - SDWebImage (5.9.1):
+    - SDWebImage/Core (= 5.9.1)
+  - SDWebImage/Core (5.9.1)
   - SwiftFormat/CLI (0.40.9)
   - SwiftLint (0.32.0)
   - SwiftyBeaver (1.7.0)
@@ -18,7 +18,7 @@ DEPENDENCIES:
   - InputBarAccessoryView
   - ReachabilitySwift
   - SCSiriWaveformView
-  - SDWebImage (~> 5.0)
+  - SDWebImage (~> 5.9.1)
   - SwiftFormat/CLI
   - SwiftLint
   - SwiftyBeaver
@@ -41,12 +41,12 @@ SPEC CHECKSUMS:
   InputBarAccessoryView: 58a348be7ea2736c7eec60e5c315511c2dbb39fd
   ReachabilitySwift: 4032e2f59586e11e3b0ebe15b167abdd587a388b
   SCSiriWaveformView: 15b9dd6f94c7536e2032b34a35c6ff74d38c7411
-  SDWebImage: 84000f962cbfa70c07f19d2234cbfcf5d779b5dc
+  SDWebImage: a990c053fff71e388a10f3357edb0be17929c9c5
   SwiftFormat: 6b67b6e7fe73d664f0cbb4f13721f130462c86a5
   SwiftLint: 009a898ef2a1c851f45e1b59349bf6ff2ddc990d
   SwiftyBeaver: 4cc0080d2e23f980652e28978db11a5c9da39165
   UICircularProgressRing: 0ff679b05a17f15ad6301a7886686837b8c301a9
 
-PODFILE CHECKSUM: 1a7acd0b609ee6aae5a5a59e591f7983e53b81ab
+PODFILE CHECKSUM: 2588d4e56923eb871c0395db08c2ee0058acfefa
 
-COCOAPODS: 1.8.4
+COCOAPODS: 1.9.3

+ 7 - 7
Pods/Manifest.lock

@@ -5,9 +5,9 @@ PODS:
   - InputBarAccessoryView/Core (4.3.1)
   - ReachabilitySwift (4.3.1)
   - SCSiriWaveformView (1.1.1)
-  - SDWebImage (5.8.0):
-    - SDWebImage/Core (= 5.8.0)
-  - SDWebImage/Core (5.8.0)
+  - SDWebImage (5.9.1):
+    - SDWebImage/Core (= 5.9.1)
+  - SDWebImage/Core (5.9.1)
   - SwiftFormat/CLI (0.40.9)
   - SwiftLint (0.32.0)
   - SwiftyBeaver (1.7.0)
@@ -18,7 +18,7 @@ DEPENDENCIES:
   - InputBarAccessoryView
   - ReachabilitySwift
   - SCSiriWaveformView
-  - SDWebImage (~> 5.0)
+  - SDWebImage (~> 5.9.1)
   - SwiftFormat/CLI
   - SwiftLint
   - SwiftyBeaver
@@ -41,12 +41,12 @@ SPEC CHECKSUMS:
   InputBarAccessoryView: 58a348be7ea2736c7eec60e5c315511c2dbb39fd
   ReachabilitySwift: 4032e2f59586e11e3b0ebe15b167abdd587a388b
   SCSiriWaveformView: 15b9dd6f94c7536e2032b34a35c6ff74d38c7411
-  SDWebImage: 84000f962cbfa70c07f19d2234cbfcf5d779b5dc
+  SDWebImage: a990c053fff71e388a10f3357edb0be17929c9c5
   SwiftFormat: 6b67b6e7fe73d664f0cbb4f13721f130462c86a5
   SwiftLint: 009a898ef2a1c851f45e1b59349bf6ff2ddc990d
   SwiftyBeaver: 4cc0080d2e23f980652e28978db11a5c9da39165
   UICircularProgressRing: 0ff679b05a17f15ad6301a7886686837b8c301a9
 
-PODFILE CHECKSUM: 1a7acd0b609ee6aae5a5a59e591f7983e53b81ab
+PODFILE CHECKSUM: 2588d4e56923eb871c0395db08c2ee0058acfefa
 
-COCOAPODS: 1.8.4
+COCOAPODS: 1.9.3

File diff suppressed because it is too large
+ 938 - 927
Pods/Pods.xcodeproj/project.pbxproj


+ 1 - 1
Pods/SDWebImage/LICENSE

@@ -1,4 +1,4 @@
-Copyright (c) 2009-2018 Olivier Poitrey rs@dailymotion.com
+Copyright (c) 2009-2020 Olivier Poitrey rs@dailymotion.com
  
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 2 - 2
Pods/SDWebImage/README.md

@@ -38,7 +38,7 @@ This library provides an async image downloader with cache support. For convenie
 ## Supported Image Formats
 
 - Image formats supported by Apple system (JPEG, PNG, TIFF, HEIC, ...), including GIF/APNG/HEIC animation
-- WebP format, including animated WebP (use the [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) project)
+- WebP format, including animated WebP (use the [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) project). Note iOS 14/macOS 11.0 supports built-in WebP decoding (no encoding).
 - Support extendable coder plugins for new image formats like BPG, AVIF. And vector format like PDF, SVG. See all the list in [Image coder plugin List](https://github.com/SDWebImage/SDWebImage/wiki/Coder-Plugin-List)
 
 ## Additional modules and Ecosystem
@@ -54,7 +54,7 @@ We support SwiftUI by building a brand new framework called [SDWebImageSwiftUI](
 The new framework introduce two View structs `WebImage` and `AnimatedImage` for SwiftUI world, `ImageIndicator` modifier for any View, `ImageManager` observable object for data source. Supports iOS 13+/macOS 10.15+/tvOS 13+/watchOS 6+ and Swift 5.1. Have a nice try and provide feedback!
 
 #### Coders for additional image formats
-- [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) - coder for WebP format. Based on [libwebp](https://chromium.googlesource.com/webm/libwebp)
+- [SDWebImageWebPCoder](https://github.com/SDWebImage/SDWebImageWebPCoder) - coder for WebP format. iOS 8+/macOS 10.10+. Based on [libwebp](https://chromium.googlesource.com/webm/libwebp)
 - [SDWebImageHEIFCoder](https://github.com/SDWebImage/SDWebImageHEIFCoder) - coder for HEIF format, iOS 8+/macOS 10.10+ support. Based on [libheif](https://github.com/strukturag/libheif)
 - [SDWebImageBPGCoder](https://github.com/SDWebImage/SDWebImageBPGCoder) - coder for BPG format. Based on [libbpg](https://github.com/mirrorer/libbpg)
 - [SDWebImageFLIFCoder](https://github.com/SDWebImage/SDWebImageFLIFCoder) - coder for FLIF format. Based on [libflif](https://github.com/FLIF-hub/FLIF)

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/NSData+ImageContentType.h

@@ -50,7 +50,7 @@ static const SDImageFormat SDImageFormatSVG       = 8;
 + (nonnull CFStringRef)sd_UTTypeFromImageFormat:(SDImageFormat)format CF_RETURNS_NOT_RETAINED NS_SWIFT_NAME(sd_UTType(from:));
 
 /**
- *  Convert UTTyppe to SDImageFormat
+ *  Convert UTType to SDImageFormat
  *
  *  @param uttype The UTType as CFStringRef
  *  @return The Format as SDImageFormat

+ 4 - 9
Pods/SDWebImage/SDWebImage/Core/NSData+ImageContentType.m

@@ -13,10 +13,8 @@
 #else
 #import <MobileCoreServices/MobileCoreServices.h>
 #endif
-#import "SDImageHEICCoderInternal.h"
+#import "SDImageIOAnimatedCoderInternal.h"
 
-// Currently Image/IO does not support WebP
-#define kSDUTTypeWebP ((__bridge CFStringRef)@"public.webp")
 #define kSVGTagEnd @"</svg>"
 
 @implementation NSData (ImageContentType)
@@ -76,12 +74,9 @@
             }
         }
         case 0x3C: {
-            if (data.length > 100) {
-                // Check end with SVG tag
-                NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(data.length - 100, 100)] encoding:NSASCIIStringEncoding];
-                if ([testString containsString:kSVGTagEnd]) {
-                    return SDImageFormatSVG;
-                }
+            // Check end with SVG tag
+            if ([data rangeOfData:[kSVGTagEnd dataUsingEncoding:NSUTF8StringEncoding] options:NSDataSearchBackwards range: NSMakeRange(data.length - MIN(100, data.length), MIN(100, data.length))].location != NSNotFound) {
+                return SDImageFormatSVG;
             }
         }
     }

+ 2 - 2
Pods/SDWebImage/SDWebImage/Core/SDAnimatedImage.h

@@ -101,11 +101,11 @@
  The scale factor of the image.
  
  @note For UIKit, this just call super instead.
- @note For AppKit, `NSImage` can contains multiple image representations with different scales. However, this class does not do that from the design. We processs the scale like UIKit. This wil actually be calculated from image size and pixel size.
+ @note For AppKit, `NSImage` can contains multiple image representations with different scales. However, this class does not do that from the design. We process the scale like UIKit. This will actually be calculated from image size and pixel size.
  */
 @property (nonatomic, readonly) CGFloat scale;
 
-// By default, animated image frames are returned by decoding just in time without keeping into memory. But you can choose to preload them into memory as well, See the decsription in `SDAnimatedImage` protocol.
+// By default, animated image frames are returned by decoding just in time without keeping into memory. But you can choose to preload them into memory as well, See the description in `SDAnimatedImage` protocol.
 // After preloaded, there is no huge difference on performance between this and UIImage's `animatedImageWithImages:duration:`. But UIImage's animation have some issues such like blanking and pausing during segue when using in `UIImageView`. It's recommend to use only if need.
 - (void)preloadAllFrames;
 - (void)unloadAllFrames;

+ 62 - 3
Pods/SDWebImage/SDWebImage/Core/SDAnimatedImage.m

@@ -13,6 +13,8 @@
 #import "SDImageFrame.h"
 #import "UIImage+MemoryCacheCost.h"
 #import "UIImage+Metadata.h"
+#import "UIImage+MultiFormat.h"
+#import "SDImageCoderHelper.h"
 #import "SDImageAssetManager.h"
 #import "objc/runtime.h"
 
@@ -23,9 +25,7 @@ static CGFloat SDImageScaleFromPath(NSString *string) {
     
     NSRegularExpression *pattern = [NSRegularExpression regularExpressionWithPattern:@"@[0-9]+\\.?[0-9]*x$" options:NSRegularExpressionAnchorsMatchLines error:nil];
     [pattern enumerateMatchesInString:name options:kNilOptions range:NSMakeRange(0, name.length) usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) {
-        if (result.range.location >= 3) {
-            scale = [string substringWithRange:NSMakeRange(result.range.location + 1, result.range.length - 2)].doubleValue;
-        }
+        scale = [string substringWithRange:NSMakeRange(result.range.location + 1, result.range.length - 2)].doubleValue;
     }];
     
     return scale;
@@ -327,3 +327,62 @@ static CGFloat SDImageScaleFromPath(NSString *string) {
 }
 
 @end
+
+@implementation SDAnimatedImage (MultiFormat)
+
++ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data {
+    return [self sd_imageWithData:data scale:1];
+}
+
++ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale {
+    return [self sd_imageWithData:data scale:scale firstFrameOnly:NO];
+}
+
++ (nullable UIImage *)sd_imageWithData:(nullable NSData *)data scale:(CGFloat)scale firstFrameOnly:(BOOL)firstFrameOnly {
+    if (!data) {
+        return nil;
+    }
+    return [[self alloc] initWithData:data scale:scale options:@{SDImageCoderDecodeFirstFrameOnly : @(firstFrameOnly)}];
+}
+
+- (nullable NSData *)sd_imageData {
+    NSData *imageData = self.animatedImageData;
+    if (imageData) {
+        return imageData;
+    } else {
+        return [self sd_imageDataAsFormat:self.animatedImageFormat];
+    }
+}
+
+- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat {
+    return [self sd_imageDataAsFormat:imageFormat compressionQuality:1];
+}
+
+- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality {
+    return [self sd_imageDataAsFormat:imageFormat compressionQuality:compressionQuality firstFrameOnly:NO];
+}
+
+- (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat compressionQuality:(double)compressionQuality firstFrameOnly:(BOOL)firstFrameOnly {
+    if (firstFrameOnly) {
+        // First frame, use super implementation
+        return [super sd_imageDataAsFormat:imageFormat compressionQuality:compressionQuality firstFrameOnly:firstFrameOnly];
+    }
+    NSUInteger frameCount = self.animatedImageFrameCount;
+    if (frameCount <= 1) {
+        // Static image, use super implementation
+        return [super sd_imageDataAsFormat:imageFormat compressionQuality:compressionQuality firstFrameOnly:firstFrameOnly];
+    }
+    // Keep animated image encoding, loop each frame.
+    NSMutableArray<SDImageFrame *> *frames = [NSMutableArray arrayWithCapacity:frameCount];
+    for (size_t i = 0; i < frameCount; i++) {
+        UIImage *image = [self animatedImageFrameAtIndex:i];
+        NSTimeInterval duration = [self animatedImageDurationAtIndex:i];
+        SDImageFrame *frame = [SDImageFrame frameWithImage:image duration:duration];
+        [frames addObject:frame];
+    }
+    UIImage *animatedImage = [SDImageCoderHelper animatedImageWithFrames:frames];
+    NSData *imageData = [animatedImage sd_imageDataAsFormat:imageFormat compressionQuality:compressionQuality firstFrameOnly:firstFrameOnly];
+    return imageData;
+}
+
+@end

+ 6 - 6
Pods/SDWebImage/SDWebImage/Core/SDAnimatedImagePlayer.h

@@ -22,7 +22,7 @@
 /// Current loop count since its latest animating. This value is KVO Compliance.
 @property (nonatomic, readonly) NSUInteger currentLoopCount;
 
-/// Total frame count for niamted image rendering. Defaults is animated image's frame count.
+/// Total frame count for animated image rendering. Defaults is animated image's frame count.
 /// @note For progressive animation, you can update this value when your provider receive more frames.
 @property (nonatomic, assign) NSUInteger totalFrameCount;
 
@@ -49,13 +49,13 @@
 
 /// Create a player with animated image provider. If the provider's `animatedImageFrameCount` is less than 1, returns nil.
 /// The provider can be any protocol implementation, like `SDAnimatedImage`, `SDImageGIFCoder`, etc.
-/// @note This provider can represent mutable content, like prorgessive animated loading. But you need to update the frame count by yourself
+/// @note This provider can represent mutable content, like progressive animated loading. But you need to update the frame count by yourself
 /// @param provider The animated provider
 - (nullable instancetype)initWithProvider:(nonnull id<SDAnimatedImageProvider>)provider;
 
 /// Create a player with animated image provider. If the provider's `animatedImageFrameCount` is less than 1, returns nil.
 /// The provider can be any protocol implementation, like `SDAnimatedImage` or `SDImageGIFCoder`, etc.
-/// @note This provider can represent mutable content, like prorgessive animated loading. But you need to update the frame count by yourself
+/// @note This provider can represent mutable content, like progressive animated loading. But you need to update the frame count by yourself
 /// @param provider The animated provider
 + (nullable instancetype)playerWithProvider:(nonnull id<SDAnimatedImageProvider>)provider;
 
@@ -65,13 +65,13 @@
 /// The handler block when one loop count finished.
 @property (nonatomic, copy, nullable) void (^animationLoopHandler)(NSUInteger loopCount);
 
-/// Return the status whehther animation is playing.
+/// Return the status whether animation is playing.
 @property (nonatomic, readonly) BOOL isPlaying;
 
 /// Start the animation. Or resume the previously paused animation.
 - (void)startPlaying;
 
-/// Pause the aniamtion. Keep the current frame index and loop count.
+/// Pause the animation. Keep the current frame index and loop count.
 - (void)pausePlaying;
 
 /// Stop the animation. Reset the current frame index and loop count.
@@ -83,7 +83,7 @@
 /// @param loopCount The loop count
 - (void)seekToFrameAtIndex:(NSUInteger)index loopCount:(NSUInteger)loopCount;
 
-/// Clear the frame cache buffer. The frame cache buffer size can be controled by `maxBufferSize`.
+/// Clear the frame cache buffer. The frame cache buffer size can be controlled by `maxBufferSize`.
 /// By default, when stop or pause the animation, the frame buffer is still kept to ready for the next restart
 - (void)clearFrameBuffer;
 

+ 4 - 3
Pods/SDWebImage/SDWebImage/Core/SDAnimatedImagePlayer.m

@@ -209,6 +209,7 @@
     }
     self.currentFrameIndex = index;
     self.currentLoopCount = loopCount;
+    self.currentFrame = [self.animatedProvider animatedImageFrameAtIndex:index];
     [self handleFrameChange];
 }
 
@@ -284,7 +285,7 @@
             return;
         }
         
-        // Otherwise, we shoudle be ready to display next frame
+        // Otherwise, we should be ready to display next frame
         self.needsDisplayWhenImageBecomesAvailable = YES;
         self.currentFrameIndex = nextFrameIndex;
         self.currentTime -= currentDuration;
@@ -299,7 +300,7 @@
         if (nextFrameIndex == 0) {
             // Update the loop count
             self.currentLoopCount++;
-            [self handleLoopChnage];
+            [self handleLoopChange];
             
             // if reached the max loop count, stop animating, 0 means loop indefinitely
             NSUInteger maxLoopCount = self.totalLoopCount;
@@ -352,7 +353,7 @@
     }
 }
 
-- (void)handleLoopChnage {
+- (void)handleLoopChange {
     if (self.animationLoopHandler) {
         self.animationLoopHandler(self.currentLoopCount);
     }

+ 18 - 5
Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageRep.m

@@ -14,7 +14,7 @@
 #import "SDImageGIFCoder.h"
 #import "SDImageAPNGCoder.h"
 #import "SDImageHEICCoder.h"
-#import "SDImageHEICCoderInternal.h"
+#import "SDImageAWebPCoder.h"
 
 @implementation SDAnimatedImageRep {
     CGImageSourceRef _imageSource;
@@ -27,13 +27,15 @@
     }
 }
 
-// `NSBitmapImageRep`'s `imageRepWithData:` is not designed initlizer
+// `NSBitmapImageRep`'s `imageRepWithData:` is not designed initializer
 + (instancetype)imageRepWithData:(NSData *)data {
     SDAnimatedImageRep *imageRep = [[SDAnimatedImageRep alloc] initWithData:data];
     return imageRep;
 }
 
-// We should override init method for `NSBitmapImageRep` to do initlize about animated image format
+// We should override init method for `NSBitmapImageRep` to do initialize about animated image format
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunguarded-availability"
 - (instancetype)initWithData:(NSData *)data {
     self = [super initWithData:data];
     if (self) {
@@ -58,18 +60,25 @@
             [self setProperty:NSImageLoopCount withValue:@(loopCount)];
         } else if (CFStringCompare(type, kUTTypePNG, 0) == kCFCompareEqualTo) {
             // APNG
-            // Do initilize about frame count, current frame/duration and loop count
+            // Do initialize about frame count, current frame/duration and loop count
             [self setProperty:NSImageFrameCount withValue:@(frameCount)];
             [self setProperty:NSImageCurrentFrame withValue:@(0)];
             NSUInteger loopCount = [SDImageAPNGCoder imageLoopCountWithSource:imageSource];
             [self setProperty:NSImageLoopCount withValue:@(loopCount)];
         } else if (CFStringCompare(type, kSDUTTypeHEICS, 0) == kCFCompareEqualTo) {
             // HEIC
-            // Do initilize about frame count, current frame/duration and loop count
+            // Do initialize about frame count, current frame/duration and loop count
             [self setProperty:NSImageFrameCount withValue:@(frameCount)];
             [self setProperty:NSImageCurrentFrame withValue:@(0)];
             NSUInteger loopCount = [SDImageHEICCoder imageLoopCountWithSource:imageSource];
             [self setProperty:NSImageLoopCount withValue:@(loopCount)];
+        } else if (CFStringCompare(type, kSDUTTypeWebP, 0) == kCFCompareEqualTo) {
+            // WebP
+            // Do initialize about frame count, current frame/duration and loop count
+            [self setProperty:NSImageFrameCount withValue:@(frameCount)];
+            [self setProperty:NSImageCurrentFrame withValue:@(0)];
+            NSUInteger loopCount = [SDImageAWebPCoder imageLoopCountWithSource:imageSource];
+            [self setProperty:NSImageLoopCount withValue:@(loopCount)];
         }
     }
     return self;
@@ -100,6 +109,9 @@
         } else if (CFStringCompare(type, kSDUTTypeHEICS, 0) == kCFCompareEqualTo) {
             // HEIC
             frameDuration = [SDImageHEICCoder frameDurationAtIndex:index source:imageSource];
+        } else if (CFStringCompare(type, kSDUTTypeWebP, 0) == kCFCompareEqualTo) {
+            // WebP
+            frameDuration = [SDImageAWebPCoder frameDurationAtIndex:index source:imageSource];
         }
         if (!frameDuration) {
             return;
@@ -108,6 +120,7 @@
         [super setProperty:NSImageCurrentFrameDuration withValue:@(frameDuration)];
     }
 }
+#pragma clang diagnostic pop
 
 @end
 

+ 10 - 2
Pods/SDWebImage/SDWebImage/Core/SDAnimatedImageView.m

@@ -16,7 +16,10 @@
 #import "SDInternalMacros.h"
 #import "objc/runtime.h"
 
-@interface SDAnimatedImageView () <CALayerDelegate> {
+@interface UIImageView () <CALayerDelegate>
+@end
+
+@interface SDAnimatedImageView () {
     BOOL _initFinished; // Extra flag to mark the `commonInit` is called
     NSRunLoopMode _runLoopMode;
     NSUInteger _maxBufferSize;
@@ -135,7 +138,7 @@
             } else {
                 provider = (id<SDAnimatedImage>)image;
             }
-            // Create animted player
+            // Create animated player
             self.player = [SDAnimatedImagePlayer playerWithProvider:provider];
         } else {
             // Update Frame Count
@@ -469,6 +472,11 @@
     if (currentFrame) {
         layer.contentsScale = currentFrame.scale;
         layer.contents = (__bridge id)currentFrame.CGImage;
+    } else {
+        // If we have no animation frames, call super implementation. iOS 14+ UIImageView use this delegate method for rendering.
+        if ([UIImageView instancesRespondToSelector:@selector(displayLayer:)]) {
+            [super displayLayer:layer];
+        }
     }
 }
 

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDDiskCache.m

@@ -86,7 +86,7 @@ static NSString * const SDDiskCacheExtendedAttributeName = @"com.hackemist.SDDis
     
     // get cache Path for image key
     NSString *cachePathForKey = [self cachePathForKey:key];
-    // transform to NSUrl
+    // transform to NSURL
     NSURL *fileURL = [NSURL fileURLWithPath:cachePathForKey];
     
     [data writeToURL:fileURL options:self.config.diskCacheWritingOptions error:nil];

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDImageAPNGCoder.m

@@ -13,7 +13,7 @@
 #import <MobileCoreServices/MobileCoreServices.h>
 #endif
 
-// iOS 8 Image/IO framework binary does not contains these APNG contants, so we define them. Thanks Apple :)
+// iOS 8 Image/IO framework binary does not contains these APNG constants, so we define them. Thanks Apple :)
 // We can not use runtime @available check for this issue, because it's a global symbol and should be loaded during launch time by dyld. So hack if the min deployment target version < iOS 9.0, whatever it running on iOS 9+ or not.
 #if (__IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0)
 const CFStringRef kCGImagePropertyAPNGLoopCount = (__bridge CFStringRef)@"LoopCount";

+ 23 - 0
Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.h

@@ -0,0 +1,23 @@
+/*
+ * This file is part of the SDWebImage package.
+ * (c) Olivier Poitrey <rs@dailymotion.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+#import <Foundation/Foundation.h>
+#import "SDImageIOAnimatedCoder.h"
+
+/**
+ This coder is used for Google WebP and Animated WebP(AWebP) image format.
+ Image/IO provide the WebP decoding support in iOS 14/macOS 11/tvOS 14/watchOS 7+.
+ @note Currently Image/IO seems does not supports WebP encoding, if you need WebP encoding, use the custom codec below.
+ @note If you need to support lower firmware version for WebP, you can have a try at https://github.com/SDWebImage/SDWebImageWebPCoder
+ */
+API_AVAILABLE(ios(14.0), tvos(14.0), macos(11.0), watchos(7.0))
+@interface SDImageAWebPCoder : SDImageIOAnimatedCoder <SDProgressiveImageCoder, SDAnimatedImageCoder>
+
+@property (nonatomic, class, readonly, nonnull) SDImageAWebPCoder *sharedCoder;
+
+@end

+ 98 - 0
Pods/SDWebImage/SDWebImage/Core/SDImageAWebPCoder.m

@@ -0,0 +1,98 @@
+/*
+* This file is part of the SDWebImage package.
+* (c) Olivier Poitrey <rs@dailymotion.com>
+*
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
+*/
+
+#import "SDImageAWebPCoder.h"
+#import "SDImageIOAnimatedCoderInternal.h"
+
+// These constants are available from iOS 14+ and Xcode 12. This raw value is used for toolchain and firmware compatibility
+static NSString * kSDCGImagePropertyWebPDictionary = @"{WebP}";
+static NSString * kSDCGImagePropertyWebPLoopCount = @"LoopCount";
+static NSString * kSDCGImagePropertyWebPDelayTime = @"DelayTime";
+static NSString * kSDCGImagePropertyWebPUnclampedDelayTime = @"UnclampedDelayTime";
+
+@implementation SDImageAWebPCoder
+
++ (void)initialize {
+#if __IPHONE_14_0 || __TVOS_14_0 || __MAC_11_0 || __WATCHOS_7_0
+    // Xcode 12
+    if (@available(iOS 14, tvOS 14, macOS 11, watchOS 7, *)) {
+        // Use SDK instead of raw value
+        kSDCGImagePropertyWebPDictionary = (__bridge NSString *)kCGImagePropertyWebPDictionary;
+        kSDCGImagePropertyWebPLoopCount = (__bridge NSString *)kCGImagePropertyWebPLoopCount;
+        kSDCGImagePropertyWebPDelayTime = (__bridge NSString *)kCGImagePropertyWebPDelayTime;
+        kSDCGImagePropertyWebPUnclampedDelayTime = (__bridge NSString *)kCGImagePropertyWebPUnclampedDelayTime;
+    }
+#endif
+}
+
++ (instancetype)sharedCoder {
+    static SDImageAWebPCoder *coder;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        coder = [[SDImageAWebPCoder alloc] init];
+    });
+    return coder;
+}
+
+#pragma mark - SDImageCoder
+
+- (BOOL)canDecodeFromData:(nullable NSData *)data {
+    switch ([NSData sd_imageFormatForImageData:data]) {
+        case SDImageFormatWebP:
+            // Check WebP decoding compatibility
+            return [self.class canDecodeFromFormat:SDImageFormatWebP];
+        default:
+            return NO;
+    }
+}
+
+- (BOOL)canIncrementalDecodeFromData:(NSData *)data {
+    return [self canDecodeFromData:data];
+}
+
+- (BOOL)canEncodeToFormat:(SDImageFormat)format {
+    switch (format) {
+        case SDImageFormatWebP:
+            // Check WebP encoding compatibility
+            return [self.class canEncodeToFormat:SDImageFormatWebP];
+        default:
+            return NO;
+    }
+}
+
+#pragma mark - Subclass Override
+
++ (SDImageFormat)imageFormat {
+    return SDImageFormatWebP;
+}
+
++ (NSString *)imageUTType {
+    return (__bridge NSString *)kSDUTTypeWebP;
+}
+
++ (NSString *)dictionaryProperty {
+    return kSDCGImagePropertyWebPDictionary;
+}
+
++ (NSString *)unclampedDelayTimeProperty {
+    return kSDCGImagePropertyWebPUnclampedDelayTime;
+}
+
++ (NSString *)delayTimeProperty {
+    return kSDCGImagePropertyWebPDelayTime;
+}
+
++ (NSString *)loopCountProperty {
+    return kSDCGImagePropertyWebPLoopCount;
+}
+
++ (NSUInteger)defaultLoopCount {
+    return 0;
+}
+
+@end

+ 16 - 6
Pods/SDWebImage/SDWebImage/Core/SDImageCache.h

@@ -40,7 +40,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
      */
     SDImageCacheAvoidDecodeImage = 1 << 4,
     /**
-     * By default, we decode the animated image. This flag can force decode the first frame only and produece the static image.
+     * By default, we decode the animated image. This flag can force decode the first frame only and produce the static image.
      */
     SDImageCacheDecodeFirstFrameOnly = 1 << 5,
     /**
@@ -49,7 +49,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
     SDImageCachePreloadAllFrames = 1 << 6,
     /**
      * By default, when you use `SDWebImageContextAnimatedImageClass` context option (like using `SDAnimatedImageView` which designed to use `SDAnimatedImage`), we may still use `UIImage` when the memory cache hit, or image decoder is not available, to behave as a fallback solution.
-     * Using this option, can ensure we always produce image with your provided class. If failed, a error with code `SDWebImageErrorBadImageData` will been used.
+     * Using this option, can ensure we always produce image with your provided class. If failed, an error with code `SDWebImageErrorBadImageData` will be used.
      * Note this options is not compatible with `SDImageCacheDecodeFirstFrameOnly`, which always produce a UIImage/NSImage.
      */
     SDImageCacheMatchAnimatedImageClass = 1 << 7,
@@ -65,7 +65,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
 
 /**
  *  Cache Config object - storing all kind of settings.
- *  The property is copy so change of currrent config will not accidentally affect other cache's config.
+ *  The property is copy so change of current config will not accidentally affect other cache's config.
  */
 @property (nonatomic, copy, nonnull, readonly) SDImageCacheConfig *config;
 
@@ -103,8 +103,18 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
  */
 @property (nonatomic, class, readonly, nonnull) SDImageCache *sharedImageCache;
 
+/**
+ * Control the default disk cache directory. This will effect all the SDImageCache instance created after modification, even for shared image cache.
+ * This can be used to share the same disk cache with the App and App Extension (Today/Notification Widget) using `- [NSFileManager.containerURLForSecurityApplicationGroupIdentifier:]`.
+ * @note If you pass nil, the value will be reset to `~/Library/Caches/com.hackemist.SDImageCache`.
+ * @note We still preserve the `namespace` arg, which means, if you change this property into `/path/to/use`,  the `SDImageCache.sharedImageCache.diskCachePath` should be `/path/to/use/default` because shared image cache use `default` as namespace.
+ * Defaults to nil.
+ */
+@property (nonatomic, class, readwrite, null_resettable) NSString *defaultDiskCacheDirectory;
+
 /**
  * Init a new cache store with a specific namespace
+ * The final disk cache directory should looks like ($directory/$namespace). And the default config of shared cache, should result in (~/Library/Caches/com.hackemist.SDImageCache/default/)
  *
  * @param ns The namespace to use for this cache store
  */
@@ -112,7 +122,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
 
 /**
  * Init a new cache store with a specific namespace and directory.
- * If you don't provide the disk cache directory, we will use the User Cache directory with prefix (~/Library/Caches/com.hackemist.SDImageCache/).
+ * The final disk cache directory should looks like ($directory/$namespace). And the default config of shared cache, should result in (~/Library/Caches/com.hackemist.SDImageCache/default/)
  *
  * @param ns        The namespace to use for this cache store
  * @param directory Directory to cache disk images in
@@ -121,7 +131,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
                        diskCacheDirectory:(nullable NSString *)directory;
 
 /**
- * Init a new cache store with a specific namespace, directory and file manager
+ * Init a new cache store with a specific namespace, directory and config.
  * The final disk cache directory should looks like ($directory/$namespace). And the default config of shared cache, should result in (~/Library/Caches/com.hackemist.SDImageCache/default/)
  *
  * @param ns          The namespace to use for this cache store
@@ -282,7 +292,7 @@ typedef NS_OPTIONS(NSUInteger, SDImageCacheOptions) {
  * @param key       The unique key used to store the wanted image. If you want transformed or thumbnail image, calculate the key with `SDTransformedKeyForKey`, `SDThumbnailedKeyForKey`, or generate the cache key from url with `cacheKeyForURL:context:`.
  * @param options   A mask to specify options to use for this cache query
  * @param context   A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
- * @param queryCacheType Specify where to query the cache from. By default we use `.all`, which means both memory cache and disk cache. You can choose to query memory only or disk only as well. Pass `.none` is invalid and callback with nil immediatelly.
+ * @param queryCacheType Specify where to query the cache from. By default we use `.all`, which means both memory cache and disk cache. You can choose to query memory only or disk only as well. Pass `.none` is invalid and callback with nil immediately.
  * @param doneBlock The completion block. Will not get called if the operation is cancelled
  *
  * @return a NSOperation instance containing the cache op

+ 25 - 16
Pods/SDWebImage/SDWebImage/Core/SDImageCache.m

@@ -15,6 +15,8 @@
 #import "UIImage+Metadata.h"
 #import "UIImage+ExtendedCacheData.h"
 
+static NSString * _defaultDiskCacheDirectory;
+
 @interface SDImageCache ()
 
 #pragma mark - Properties
@@ -40,6 +42,17 @@
     return instance;
 }
 
++ (NSString *)defaultDiskCacheDirectory {
+    if (!_defaultDiskCacheDirectory) {
+        _defaultDiskCacheDirectory = [[self userCacheDirectory] stringByAppendingPathComponent:@"com.hackemist.SDImageCache"];
+    }
+    return _defaultDiskCacheDirectory;
+}
+
++ (void)setDefaultDiskCacheDirectory:(NSString *)defaultDiskCacheDirectory {
+    _defaultDiskCacheDirectory = [defaultDiskCacheDirectory copy];
+}
+
 - (instancetype)init {
     return [self initWithNamespace:@"default"];
 }
@@ -72,12 +85,11 @@
         _memoryCache = [[config.memoryCacheClass alloc] initWithConfig:_config];
         
         // Init the disk cache
-        if (directory != nil) {
-            _diskCachePath = [directory stringByAppendingPathComponent:ns];
-        } else {
-            NSString *path = [[[self userCacheDirectory] stringByAppendingPathComponent:@"com.hackemist.SDImageCache"] stringByAppendingPathComponent:ns];
-            _diskCachePath = path;
+        if (!directory) {
+            // Use default disk cache directory
+            directory = [self.class defaultDiskCacheDirectory];
         }
+        _diskCachePath = [directory stringByAppendingPathComponent:ns];
         
         NSAssert([config.diskCacheClass conformsToProtocol:@protocol(SDDiskCache)], @"Custom disk cache class must conform to `SDDiskCache` protocol");
         _diskCache = [[config.diskCacheClass alloc] initWithCachePath:_diskCachePath config:_config];
@@ -121,7 +133,7 @@
     return [self.diskCache cachePathForKey:key];
 }
 
-- (nullable NSString *)userCacheDirectory {
++ (nullable NSString *)userCacheDirectory {
     NSArray<NSString *> *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
     return paths.firstObject;
 }
@@ -131,9 +143,9 @@
         static dispatch_once_t onceToken;
         dispatch_once(&onceToken, ^{
             // ~/Library/Caches/com.hackemist.SDImageCache/default/
-            NSString *newDefaultPath = [[[self userCacheDirectory] stringByAppendingPathComponent:@"com.hackemist.SDImageCache"] stringByAppendingPathComponent:@"default"];
+            NSString *newDefaultPath = [[[self.class userCacheDirectory] stringByAppendingPathComponent:@"com.hackemist.SDImageCache"] stringByAppendingPathComponent:@"default"];
             // ~/Library/Caches/default/com.hackemist.SDWebImageCache.default/
-            NSString *oldDefaultPath = [[[self userCacheDirectory] stringByAppendingPathComponent:@"default"] stringByAppendingPathComponent:@"com.hackemist.SDWebImageCache.default"];
+            NSString *oldDefaultPath = [[[self.class userCacheDirectory] stringByAppendingPathComponent:@"default"] stringByAppendingPathComponent:@"com.hackemist.SDWebImageCache.default"];
             dispatch_async(self.ioQueue, ^{
                 [((SDDiskCache *)self.diskCache) moveCacheDirectoryFromPath:oldDefaultPath toPath:newDefaultPath];
             });
@@ -269,7 +281,7 @@
     });
 }
 
-// Make sure to call form io queue by caller
+// Make sure to call from io queue by caller
 - (void)_storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key {
     if (!imageData || !key) {
         return;
@@ -304,7 +316,7 @@
     return exists;
 }
 
-// Make sure to call form io queue by caller
+// Make sure to call from io queue by caller
 - (BOOL)_diskImageDataExistsWithKey:(nullable NSString *)key {
     if (!key) {
         return NO;
@@ -516,13 +528,10 @@
         @autoreleasepool {
             NSData *diskData = [self diskImageDataBySearchingAllPathsForKey:key];
             UIImage *diskImage;
-            SDImageCacheType cacheType = SDImageCacheTypeNone;
             if (image) {
                 // the image is from in-memory cache, but need image data
                 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 context:context];
                 if (diskImage && self.config.shouldCacheImagesInMemory) {
@@ -533,10 +542,10 @@
             
             if (doneBlock) {
                 if (shouldQueryDiskSync) {
-                    doneBlock(diskImage, diskData, cacheType);
+                    doneBlock(diskImage, diskData, SDImageCacheTypeDisk);
                 } else {
                     dispatch_async(dispatch_get_main_queue(), ^{
-                        doneBlock(diskImage, diskData, cacheType);
+                        doneBlock(diskImage, diskData, SDImageCacheTypeDisk);
                     });
                 }
             }
@@ -604,7 +613,7 @@
     });
 }
 
-// Make sure to call form io queue by caller
+// Make sure to call from io queue by caller
 - (void)_removeImageFromDiskForKey:(NSString *)key {
     if (!key) {
         return;

+ 4 - 4
Pods/SDWebImage/SDWebImage/Core/SDImageCacheConfig.h

@@ -57,7 +57,7 @@ typedef NS_ENUM(NSUInteger, SDImageCacheConfigExpireType) {
 /*
  * The option to control weak memory cache for images. When enable, `SDImageCache`'s memory cache will use a weak maptable to store the image at the same time when it stored to memory, and get removed at the same time.
  * However when memory warning is triggered, since the weak maptable does not hold a strong reference to image instance, even when the memory cache itself is purged, some images which are held strongly by UIImageViews or other live instances can be recovered again, to avoid later re-query from disk cache or network. This may be helpful for the case, for example, when app enter background and memory is purged, cause cell flashing after re-enter foreground.
- * Defautls to YES. You can change this option dynamically.
+ * Defaults to YES. You can change this option dynamically.
  */
 @property (assign, nonatomic) BOOL shouldUseWeakMemoryCache;
 
@@ -115,7 +115,7 @@ typedef NS_ENUM(NSUInteger, SDImageCacheConfigExpireType) {
 /**
  * The custom file manager for disk cache. Pass nil to let disk cache choose the proper file manager.
  * Defaults to nil.
- * @note This value does not support dynamic changes. Which means further modification on this value after cache initlized has no effect.
+ * @note This value does not support dynamic changes. Which means further modification on this value after cache initialized has no effect.
  * @note Since `NSFileManager` does not support `NSCopying`. We just pass this by reference during copying. So it's not recommend to set this value on `defaultCacheConfig`.
  */
 @property (strong, nonatomic, nullable) NSFileManager *fileManager;
@@ -123,14 +123,14 @@ typedef NS_ENUM(NSUInteger, SDImageCacheConfigExpireType) {
 /**
  * The custom memory cache class. Provided class instance must conform to `SDMemoryCache` protocol to allow usage.
  * Defaults to built-in `SDMemoryCache` class.
- * @note This value does not support dynamic changes. Which means further modification on this value after cache initlized has no effect.
+ * @note This value does not support dynamic changes. Which means further modification on this value after cache initialized has no effect.
  */
 @property (assign, nonatomic, nonnull) Class memoryCacheClass;
 
 /**
  * The custom disk cache class. Provided class instance must conform to `SDDiskCache` protocol to allow usage.
  * Defaults to built-in `SDDiskCache` class.
- * @note This value does not support dynamic changes. Which means further modification on this value after cache initlized has no effect.
+ * @note This value does not support dynamic changes. Which means further modification on this value after cache initialized has no effect.
  */
 @property (assign ,nonatomic, nonnull) Class diskCacheClass;
 

+ 7 - 7
Pods/SDWebImage/SDWebImage/Core/SDImageCacheDefine.h

@@ -64,7 +64,7 @@ FOUNDATION_EXPORT UIImage * _Nullable SDImageCacheDecodeImageData(NSData * _Nonn
 @required
 /**
  Query the cached image from image cache for given key. The operation can be used to cancel the query.
- If image is cached in memory, completion is called synchronously, else aynchronously and depends on the options arg (See `SDWebImageQueryDiskSync`)
+ If image is cached in memory, completion is called synchronously, else asynchronously and depends on the options arg (See `SDWebImageQueryDiskSync`)
 
  @param key The image cache key
  @param options A mask to specify options to use for this query
@@ -79,12 +79,12 @@ FOUNDATION_EXPORT UIImage * _Nullable SDImageCacheDecodeImageData(NSData * _Nonn
 
 /**
  Query the cached image from image cache for given key. The operation can be used to cancel the query.
- If image is cached in memory, completion is called synchronously, else aynchronously and depends on the options arg (See `SDWebImageQueryDiskSync`)
+ If image is cached in memory, completion is called synchronously, else asynchronously and depends on the options arg (See `SDWebImageQueryDiskSync`)
 
  @param key The image cache key
  @param options A mask to specify options to use for this query
  @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
- @param cacheType Specify where to query the cache from. By default we use `.all`, which means both memory cache and disk cache. You can choose to query memory only or disk only as well. Pass `.none` is invalid and callback with nil immediatelly.
+ @param cacheType Specify where to query the cache from. By default we use `.all`, which means both memory cache and disk cache. You can choose to query memory only or disk only as well. Pass `.none` is invalid and callback with nil immediately.
  @param completionBlock The completion block. Will not get called if the operation is cancelled
  @return The operation for this query
  */
@@ -95,7 +95,7 @@ FOUNDATION_EXPORT UIImage * _Nullable SDImageCacheDecodeImageData(NSData * _Nonn
                                           completion:(nullable SDImageCacheQueryCompletionBlock)completionBlock;
 
 /**
- Store the image into image cache for the given key. If cache type is memory only, completion is called synchronously, else aynchronously.
+ Store the image into image cache for the given key. If cache type is memory only, completion is called synchronously, else asynchronously.
 
  @param image The image to store
  @param imageData The image data to be used for disk storage
@@ -110,7 +110,7 @@ FOUNDATION_EXPORT UIImage * _Nullable SDImageCacheDecodeImageData(NSData * _Nonn
         completion:(nullable SDWebImageNoParamsBlock)completionBlock;
 
 /**
- Remove the image from image cache for the given key. If cache type is memory only, completion is called synchronously, else aynchronously.
+ Remove the image from image cache for the given key. If cache type is memory only, completion is called synchronously, else asynchronously.
 
  @param key The image cache key
  @param cacheType The image remove op cache type
@@ -121,7 +121,7 @@ FOUNDATION_EXPORT UIImage * _Nullable SDImageCacheDecodeImageData(NSData * _Nonn
                completion:(nullable SDWebImageNoParamsBlock)completionBlock;
 
 /**
- Check if image cache contains the image for the given key (does not load the image). If image is cached in memory, completion is called synchronously, else aynchronously.
+ Check if image cache contains the image for the given key (does not load the image). If image is cached in memory, completion is called synchronously, else asynchronously.
 
  @param key The image cache key
  @param cacheType The image contains op cache type
@@ -132,7 +132,7 @@ FOUNDATION_EXPORT UIImage * _Nullable SDImageCacheDecodeImageData(NSData * _Nonn
                  completion:(nullable SDImageCacheContainsCompletionBlock)completionBlock;
 
 /**
- Clear all the cached images for image cache. If cache type is memory only, completion is called synchronously, else aynchronously.
+ Clear all the cached images for image cache. If cache type is memory only, completion is called synchronously, else asynchronously.
 
  @param cacheType The image clear op cache type
  @param completionBlock A block executed after the operation is finished

+ 4 - 4
Pods/SDWebImage/SDWebImage/Core/SDImageCoder.h

@@ -67,14 +67,14 @@ FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderEncodeBackground
  A CGSize value indicating the max image resolution in pixels during encoding. For vector image, this also effect the output vector data information about width and height. The encoder will not generate the encoded image larger than this limit. Note it always use the aspect ratio of input image..
  Defaults to CGSizeZero, which means no max size limit at all.
  @note Supports for animated image as well.
- @note The ouput image's width is limited to pixel size's width, the output image's height is limited to pixel size's height. For common cases, you can just pass a square size to limit both.
+ @note The output image's width is limited to pixel size's width, the output image's height is limited to pixel size's height. For common cases, you can just pass a square size to limit both.
  @note works for `SDImageCoder`
  */
 FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderEncodeMaxPixelSize;
 
 /**
- A NSUInteger value specify the max ouput data bytes size after encoding. Some lossy format like JPEG/HEIF supports the hint for codec to automatically reduce the quality and match the file size you want. Note this option will override the `SDImageCoderEncodeCompressionQuality`, because now the quality is decided by the encoder. (NSNumber)
- @note This is a hint, no gurantee for output size because of compression algorithm limit. And this options does not works for vector images.
+ A NSUInteger value specify the max output data bytes size after encoding. Some lossy format like JPEG/HEIF supports the hint for codec to automatically reduce the quality and match the file size you want. Note this option will override the `SDImageCoderEncodeCompressionQuality`, because now the quality is decided by the encoder. (NSNumber)
+ @note This is a hint, no guarantee for output size because of compression algorithm limit. And this options does not works for vector images.
  @note works for `SDImageCoder`
  */
 FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderEncodeMaxFileSize;
@@ -90,7 +90,7 @@ FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderEncodeEmbedThumb
 /**
  A SDWebImageContext object which hold the original context options from top-level API. (SDWebImageContext)
  This option is ignored for all built-in coders and take no effect.
- But this may be useful for some custom coders, because some business logic may dependent on things other than image or image data inforamtion only.
+ But this may be useful for some custom coders, because some business logic may dependent on things other than image or image data information only.
  See `SDWebImageContext` for more detailed information.
  */
 FOUNDATION_EXPORT SDImageCoderOption _Nonnull const SDImageCoderWebImageContext API_DEPRECATED("The coder component will be seperated from Core subspec in the future. Update your code to not rely on this context option.", macos(10.10, API_TO_BE_DEPRECATED), ios(8.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED));;

+ 4 - 3
Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.h

@@ -91,7 +91,8 @@
 + (UIImage * _Nullable)decodedImageWithImage:(UIImage * _Nullable)image;
 
 /**
- Return the decoded and probably scaled down image by the provided image. If the image is large than the limit size, will try to scale down. Or just works as `decodedImageWithImage:`
+ Return the decoded and probably scaled down image by the provided image. If the image pixels bytes size large than the limit bytes, will try to scale down. Or just works as `decodedImageWithImage:`, never scale up.
+ @warning You should not pass too small bytes, the suggestion value should be larger than 1MB. Even we use Tile Decoding to avoid OOM, however, small bytes will consume much more CPU time because we need to iterate more times to draw each tile.
 
  @param image The image to be decoded and scaled down
  @param bytes The limit bytes size. Provide 0 to use the build-in limit.
@@ -100,8 +101,8 @@
 + (UIImage * _Nullable)decodedAndScaledDownImageWithImage:(UIImage * _Nullable)image limitBytes:(NSUInteger)bytes;
 
 /**
- Control the default limit bytes to scale down larget images.
- This value must be larger than or equal to 1MB. Defaults to 60MB on iOS/tvOS, 90MB on macOS, 30MB on watchOS.
+ Control the default limit bytes to scale down largest images.
+ This value must be larger than 4 Bytes (at least 1x1 pixel). Defaults to 60MB on iOS/tvOS, 90MB on macOS, 30MB on watchOS.
  */
 @property (class, readwrite) NSUInteger defaultScaleDownLimitBytes;
 

+ 10 - 14
Pods/SDWebImage/SDWebImage/Core/SDImageCoderHelper.m

@@ -25,7 +25,6 @@ static const size_t kBytesPerPixel = 4;
 static const size_t kBitsPerComponent = 8;
 
 static const CGFloat kBytesPerMB = 1024.0f * 1024.0f;
-static const CGFloat kPixelsPerMB = kBytesPerMB / kBytesPerPixel;
 /*
  * Defines the maximum size in MB of the decoded image when the flag `SDWebImageScaleDownLargeImages` is set
  * Suggested value for iPad1 and iPhone 3GS: 60.
@@ -379,8 +378,8 @@ static const CGFloat kDestSeemOverlap = 2.0f;   // the numbers of pixels to over
         // see kDestImageSizeMB, and how it relates to destTotalPixels.
         CGFloat imageScale = sqrt(destTotalPixels / sourceTotalPixels);
         CGSize destResolution = CGSizeZero;
-        destResolution.width = (int)(sourceResolution.width * imageScale);
-        destResolution.height = (int)(sourceResolution.height * imageScale);
+        destResolution.width = MAX(1, (int)(sourceResolution.width * imageScale));
+        destResolution.height = MAX(1, (int)(sourceResolution.height * imageScale));
         
         // device color space
         CGColorSpaceRef colorspaceRef = [self colorSpaceGetDeviceRGB];
@@ -406,20 +405,20 @@ static const CGFloat kDestSeemOverlap = 2.0f;   // the numbers of pixels to over
         CGContextSetInterpolationQuality(destContext, kCGInterpolationHigh);
         
         // Now define the size of the rectangle to be used for the
-        // incremental blits from the input image to the output image.
+        // incremental bits from the input image to the output image.
         // we use a source tile width equal to the width of the source
         // image due to the way that iOS retrieves image data from disk.
         // iOS must decode an image from disk in full width 'bands', even
         // if current graphics context is clipped to a subrect within that
         // band. Therefore we fully utilize all of the pixel data that results
-        // from a decoding opertion by achnoring our tile size to the full
+        // from a decoding operation by anchoring our tile size to the full
         // width of the input image.
         CGRect sourceTile = CGRectZero;
         sourceTile.size.width = sourceResolution.width;
         // The source tile height is dynamic. Since we specified the size
         // of the source tile in MB, see how many rows of pixels high it
         // can be given the input image width.
-        sourceTile.size.height = (int)(tileTotalPixels / sourceTile.size.width );
+        sourceTile.size.height = MAX(1, (int)(tileTotalPixels / sourceTile.size.width));
         sourceTile.origin.x = 0.0f;
         // The output tile is the same proportions as the input tile, but
         // scaled to image scale.
@@ -428,7 +427,7 @@ static const CGFloat kDestSeemOverlap = 2.0f;   // the numbers of pixels to over
         destTile.size.height = sourceTile.size.height * imageScale;
         destTile.origin.x = 0.0f;
         // The source seem overlap is proportionate to the destination seem overlap.
-        // this is the amount of pixels to overlap each tile as we assemble the ouput image.
+        // this is the amount of pixels to overlap each tile as we assemble the output image.
         float sourceSeemOverlap = (int)((kDestSeemOverlap/destResolution.height)*sourceResolution.height);
         CGImageRef sourceTileImageRef;
         // calculate the number of read/write operations required to assemble the
@@ -485,7 +484,7 @@ static const CGFloat kDestSeemOverlap = 2.0f;   // the numbers of pixels to over
 }
 
 + (void)setDefaultScaleDownLimitBytes:(NSUInteger)defaultScaleDownLimitBytes {
-    if (defaultScaleDownLimitBytes < kBytesPerMB) {
+    if (defaultScaleDownLimitBytes < kBytesPerPixel) {
         return;
     }
     kDestImageLimitBytes = defaultScaleDownLimitBytes;
@@ -561,7 +560,7 @@ static const CGFloat kDestSeemOverlap = 2.0f;   // the numbers of pixels to over
 }
 #endif
 
-#pragma mark - Helper Fuction
+#pragma mark - Helper Function
 + (BOOL)shouldDecodeImage:(nullable UIImage *)image {
     // Prevent "CGBitmapContextCreateImage: invalid context 0x0" error
     if (image == nil) {
@@ -596,13 +595,10 @@ static const CGFloat kDestSeemOverlap = 2.0f;   // the numbers of pixels to over
     }
     CGFloat destTotalPixels;
     if (bytes == 0) {
-        bytes = kDestImageLimitBytes;
+        bytes = [self defaultScaleDownLimitBytes];
     }
+    bytes = MAX(bytes, kBytesPerPixel);
     destTotalPixels = bytes / kBytesPerPixel;
-    if (destTotalPixels <= kPixelsPerMB) {
-        // Too small to scale down
-        return NO;
-    }
     float imageScale = destTotalPixels / sourceTotalPixels;
     if (imageScale < 1) {
         shouldScaleDown = YES;

+ 1 - 0
Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.h

@@ -17,6 +17,7 @@
  @note This coder is not in the default coder list for now, since HEIC animated image is really rare, and Apple's implementation still contains performance issues. You can enable if you need this.
  @note If you need to support lower firmware version for HEIF, you can have a try at https://github.com/SDWebImage/SDWebImageHEIFCoder
  */
+API_AVAILABLE(ios(13.0), tvos(13.0), macos(10.15), watchos(6.0))
 @interface SDImageHEICCoder : SDImageIOAnimatedCoder <SDProgressiveImageCoder, SDAnimatedImageCoder>
 
 @property (nonatomic, class, readonly, nonnull) SDImageHEICCoder *sharedCoder;

+ 6 - 69
Pods/SDWebImage/SDWebImage/Core/SDImageHEICCoder.m

@@ -7,9 +7,9 @@
 */
 
 #import "SDImageHEICCoder.h"
-#import "SDImageHEICCoderInternal.h"
+#import "SDImageIOAnimatedCoderInternal.h"
 
-// These constantce are available from iOS 13+ and Xcode 11. This raw value is used for toolchain and firmware compatiblitiy
+// These constants are available from iOS 13+ and Xcode 11. This raw value is used for toolchain and firmware compatibility
 static NSString * kSDCGImagePropertyHEICSDictionary = @"{HEICS}";
 static NSString * kSDCGImagePropertyHEICSLoopCount = @"LoopCount";
 static NSString * kSDCGImagePropertyHEICSDelayTime = @"DelayTime";
@@ -45,10 +45,10 @@ static NSString * kSDCGImagePropertyHEICSUnclampedDelayTime = @"UnclampedDelayTi
     switch ([NSData sd_imageFormatForImageData:data]) {
         case SDImageFormatHEIC:
             // Check HEIC decoding compatibility
-            return [self.class canDecodeFromHEICFormat];
+            return [self.class canDecodeFromFormat:SDImageFormatHEIC];
         case SDImageFormatHEIF:
             // Check HEIF decoding compatibility
-            return [self.class canDecodeFromHEIFFormat];
+            return [self.class canDecodeFromFormat:SDImageFormatHEIF];
         default:
             return NO;
     }
@@ -62,78 +62,15 @@ static NSString * kSDCGImagePropertyHEICSUnclampedDelayTime = @"UnclampedDelayTi
     switch (format) {
         case SDImageFormatHEIC:
             // Check HEIC encoding compatibility
-            return [self.class canEncodeToHEICFormat];
+            return [self.class canEncodeToFormat:SDImageFormatHEIC];
         case SDImageFormatHEIF:
             // Check HEIF encoding compatibility
-            return [self.class canEncodeToHEIFFormat];
+            return [self.class canEncodeToFormat:SDImageFormatHEIF];
         default:
             return NO;
     }
 }
 
-#pragma mark - HEIF Format
-
-+ (BOOL)canDecodeFromFormat:(SDImageFormat)format {
-    CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:format];
-    NSArray *imageUTTypes = (__bridge_transfer NSArray *)CGImageSourceCopyTypeIdentifiers();
-    if ([imageUTTypes containsObject:(__bridge NSString *)(imageUTType)]) {
-        return YES;
-    }
-    return NO;
-}
-
-+ (BOOL)canDecodeFromHEICFormat {
-    static BOOL canDecode = NO;
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        canDecode = [self canDecodeFromFormat:SDImageFormatHEIC];
-    });
-    return canDecode;
-}
-
-+ (BOOL)canDecodeFromHEIFFormat {
-    static BOOL canDecode = NO;
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        canDecode = [self canDecodeFromFormat:SDImageFormatHEIF];
-    });
-    return canDecode;
-}
-
-+ (BOOL)canEncodeToFormat:(SDImageFormat)format {
-    NSMutableData *imageData = [NSMutableData data];
-    CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:format];
-    
-    // Create an image destination.
-    CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, 1, NULL);
-    if (!imageDestination) {
-        // Can't encode to HEIC
-        return NO;
-    } else {
-        // Can encode to HEIC
-        CFRelease(imageDestination);
-        return YES;
-    }
-}
-
-+ (BOOL)canEncodeToHEICFormat {
-    static BOOL canEncode = NO;
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        canEncode = [self canEncodeToFormat:SDImageFormatHEIC];
-    });
-    return canEncode;
-}
-
-+ (BOOL)canEncodeToHEIFFormat {
-    static BOOL canEncode = NO;
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        canEncode = [self canEncodeToFormat:SDImageFormatHEIF];
-    });
-    return canEncode;
-}
-
 #pragma mark - Subclass Override
 
 + (SDImageFormat)imageFormat {

+ 2 - 2
Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.h

@@ -12,7 +12,7 @@
 
 /**
  This is the abstract class for all animated coder, which use the Image/IO API. You can not use this directly as real coders. A exception will be raised if you use this class.
- All of the properties need the subclass to implment and works as expceted.
+ All of the properties need the subclass to implement and works as expected.
  For Image/IO, See Apple's documentation: https://developer.apple.com/documentation/imageio
  */
 @interface SDImageIOAnimatedCoder : NSObject <SDProgressiveImageCoder, SDAnimatedImageCoder>
@@ -35,7 +35,7 @@
  */
 @property (class, readonly, nonnull) NSString *dictionaryProperty;
 /**
- The image unclamped deply time property key used in Image/IO  API. Such as `kCGImagePropertyGIFUnclampedDelayTime`
+ The image unclamped delay time property key used in Image/IO  API. Such as `kCGImagePropertyGIFUnclampedDelayTime`
  @note Subclass override.
  */
 @property (class, readonly, nonnull) NSString *unclampedDelayTimeProperty;

+ 39 - 8
Pods/SDWebImage/SDWebImage/Core/SDImageIOAnimatedCoder.m

@@ -108,9 +108,39 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
 
 #pragma mark - Utils
 
++ (BOOL)canDecodeFromFormat:(SDImageFormat)format {
+    static dispatch_once_t onceToken;
+    static NSSet *imageUTTypeSet;
+    dispatch_once(&onceToken, ^{
+        NSArray *imageUTTypes = (__bridge_transfer NSArray *)CGImageSourceCopyTypeIdentifiers();
+        imageUTTypeSet = [NSSet setWithArray:imageUTTypes];
+    });
+    CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:format];
+    if ([imageUTTypeSet containsObject:(__bridge NSString *)(imageUTType)]) {
+        // Can decode from target format
+        return YES;
+    }
+    return NO;
+}
+
++ (BOOL)canEncodeToFormat:(SDImageFormat)format {
+    static dispatch_once_t onceToken;
+    static NSSet *imageUTTypeSet;
+    dispatch_once(&onceToken, ^{
+        NSArray *imageUTTypes = (__bridge_transfer NSArray *)CGImageDestinationCopyTypeIdentifiers();
+        imageUTTypeSet = [NSSet setWithArray:imageUTTypes];
+    });
+    CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:format];
+    if ([imageUTTypeSet containsObject:(__bridge NSString *)(imageUTType)]) {
+        // Can encode to target format
+        return YES;
+    }
+    return NO;
+}
+
 + (NSUInteger)imageLoopCountWithSource:(CGImageSourceRef)source {
     NSUInteger loopCount = self.defaultLoopCount;
-    NSDictionary *imageProperties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(source, nil);
+    NSDictionary *imageProperties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(source, NULL);
     NSDictionary *containerProperties = imageProperties[self.dictionaryProperty];
     if (containerProperties) {
         NSNumber *containerLoopCount = containerProperties[self.loopCountProperty];
@@ -182,7 +212,8 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
         decodingOptions = [NSMutableDictionary dictionary];
     }
     CGImageRef imageRef;
-    if (thumbnailSize.width == 0 || thumbnailSize.height == 0 || pixelWidth == 0 || pixelHeight == 0 || (pixelWidth <= thumbnailSize.width && pixelHeight <= thumbnailSize.height)) {
+    BOOL createFullImage = thumbnailSize.width == 0 || thumbnailSize.height == 0 || pixelWidth == 0 || pixelHeight == 0 || (pixelWidth <= thumbnailSize.width && pixelHeight <= thumbnailSize.height);
+    if (createFullImage) {
         if (isVector) {
             if (thumbnailSize.width == 0 || thumbnailSize.height == 0) {
                 // Provide the default pixel count for vector images, simply just use the screen size
@@ -199,7 +230,7 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
             NSUInteger rasterizationDPI = maxPixelSize * DPIPerPixel;
             decodingOptions[kSDCGImageSourceRasterizationDPI] = @(rasterizationDPI);
         }
-        imageRef = CGImageSourceCreateImageAtIndex(source, index, (__bridge CFDictionaryRef)decodingOptions);
+        imageRef = CGImageSourceCreateImageAtIndex(source, index, (__bridge CFDictionaryRef)[decodingOptions copy]);
     } else {
         decodingOptions[(__bridge NSString *)kCGImageSourceCreateThumbnailWithTransform] = @(preserveAspectRatio);
         CGFloat maxPixelSize;
@@ -215,14 +246,14 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
             maxPixelSize = MAX(thumbnailSize.width, thumbnailSize.height);
         }
         decodingOptions[(__bridge NSString *)kCGImageSourceThumbnailMaxPixelSize] = @(maxPixelSize);
-        decodingOptions[(__bridge NSString *)kCGImageSourceCreateThumbnailFromImageIfAbsent] = @(YES);
-        imageRef = CGImageSourceCreateThumbnailAtIndex(source, index, (__bridge CFDictionaryRef)decodingOptions);
+        decodingOptions[(__bridge NSString *)kCGImageSourceCreateThumbnailFromImageAlways] = @(YES);
+        imageRef = CGImageSourceCreateThumbnailAtIndex(source, index, (__bridge CFDictionaryRef)[decodingOptions copy]);
     }
     if (!imageRef) {
         return nil;
     }
-    
-    if (thumbnailSize.width > 0 && thumbnailSize.height > 0) {
+    // Thumbnail image post-process
+    if (!createFullImage) {
         if (preserveAspectRatio) {
             // kCGImageSourceCreateThumbnailWithTransform will apply EXIF transform as well, we should not apply twice
             exifOrientation = kCGImagePropertyOrientationUp;
@@ -468,7 +499,7 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
     NSUInteger pixelWidth = CGImageGetWidth(imageRef);
     NSUInteger pixelHeight = CGImageGetHeight(imageRef);
     CGFloat finalPixelSize = 0;
-    if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && pixelWidth > 0 && pixelHeight > 0) {
+    if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && pixelWidth > maxPixelSize.width && pixelHeight > maxPixelSize.height) {
         CGFloat pixelRatio = pixelWidth / pixelHeight;
         CGFloat maxPixelSizeRatio = maxPixelSize.width / maxPixelSize.height;
         if (pixelRatio > maxPixelSizeRatio) {

+ 3 - 28
Pods/SDWebImage/SDWebImage/Core/SDImageIOCoder.m

@@ -11,7 +11,6 @@
 #import "NSImage+Compatibility.h"
 #import <ImageIO/ImageIO.h>
 #import "UIImage+Metadata.h"
-#import "SDImageHEICCoderInternal.h"
 #import "SDImageIOAnimatedCoderInternal.h"
 
 // Specify File Size for lossy format encoding, like JPEG
@@ -55,19 +54,7 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
 
 #pragma mark - Decode
 - (BOOL)canDecodeFromData:(nullable NSData *)data {
-    switch ([NSData sd_imageFormatForImageData:data]) {
-        case SDImageFormatWebP:
-            // Do not support WebP decoding
-            return NO;
-        case SDImageFormatHEIC:
-            // Check HEIC decoding compatibility
-            return [SDImageHEICCoder canDecodeFromHEICFormat];
-        case SDImageFormatHEIF:
-            // Check HEIF decoding compatibility
-            return [SDImageHEICCoder canDecodeFromHEIFFormat];
-        default:
-            return YES;
-    }
+    return YES;
 }
 
 - (UIImage *)decodedImageWithData:(NSData *)data options:(nullable SDImageCoderOptions *)options {
@@ -205,19 +192,7 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
 
 #pragma mark - Encode
 - (BOOL)canEncodeToFormat:(SDImageFormat)format {
-    switch (format) {
-        case SDImageFormatWebP:
-            // Do not support WebP encoding
-            return NO;
-        case SDImageFormatHEIC:
-            // Check HEIC encoding compatibility
-            return [SDImageHEICCoder canEncodeToHEICFormat];
-        case SDImageFormatHEIF:
-            // Check HEIF encoding compatibility
-            return [SDImageHEICCoder canEncodeToHEIFFormat];
-        default:
-            return YES;
-    }
+    return YES;
 }
 
 - (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format options:(nullable SDImageCoderOptions *)options {
@@ -277,7 +252,7 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
     }
     NSUInteger pixelWidth = CGImageGetWidth(imageRef);
     NSUInteger pixelHeight = CGImageGetHeight(imageRef);
-    if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && pixelWidth > 0 && pixelHeight > 0) {
+    if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && pixelWidth > maxPixelSize.width && pixelHeight > maxPixelSize.height) {
         CGFloat pixelRatio = pixelWidth / pixelHeight;
         CGFloat maxPixelSizeRatio = maxPixelSize.width / maxPixelSize.height;
         CGFloat finalPixelSize;

+ 5 - 5
Pods/SDWebImage/SDWebImage/Core/SDImageLoader.h

@@ -18,7 +18,7 @@ typedef void(^SDImageLoaderCompletedBlock)(UIImage * _Nullable image, NSData * _
 /**
  A `UIImage` instance from `SDWebImageManager` when you specify `SDWebImageRefreshCached` and image cache hit.
  This can be a hint for image loader to load the image from network and refresh the image from remote location if needed. If the image from remote location does not change, you should call the completion with `SDWebImageErrorCacheNotModified` error. (UIImage)
- @note If you don't implement `SDWebImageRefreshCached` support, you do not need to care abot this context option.
+ @note If you don't implement `SDWebImageRefreshCached` support, you do not need to care about this context option.
  */
 FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextLoaderCachedImage;
 
@@ -53,16 +53,16 @@ FOUNDATION_EXPORT UIImage * _Nullable SDImageLoaderDecodeProgressiveImageData(NS
 #pragma mark - SDImageLoader
 
 /**
- This is the protocol to specify custom image load process. You can create your own class to conform this protocol and use as a image loader to load image from network or any avaiable remote resources defined by yourself.
+ This is the protocol to specify custom image load process. You can create your own class to conform this protocol and use as a image loader to load image from network or any available remote resources defined by yourself.
  If you want to implement custom loader for image download from network or local file, you just need to concentrate on image data download only. After the download finish, call `SDImageLoaderDecodeImageData` or `SDImageLoaderDecodeProgressiveImageData` to use the built-in decoding process and produce image (Remember to call in the global queue). And finally callback the completion block.
- If you directlly get the image instance using some third-party SDKs, such as image directlly from Photos framework. You can process the image data and image instance by yourself without that built-in decoding process. And finally callback the completion block.
+ If you directly get the image instance using some third-party SDKs, such as image directly from Photos framework. You can process the image data and image instance by yourself without that built-in decoding process. And finally callback the completion block.
  @note It's your responsibility to load the image in the desired global queue(to avoid block main queue). We do not dispatch these method call in a global queue but just from the call queue (For `SDWebImageManager`, it typically call from the main queue).
 */
 @protocol SDImageLoader <NSObject>
 
 /**
  Whether current image loader supports to load the provide image URL.
- This will be checked everytime a new image request come for loader. If this return NO, we will mark this image load as failed. If return YES, we will start to call `requestImageWithURL:options:context:progress:completed:`.
+ This will be checked every time a new image request come for loader. If this return NO, we will mark this image load as failed. If return YES, we will start to call `requestImageWithURL:options:context:progress:completed:`.
 
  @param url The image URL to be loaded.
  @return YES to continue download, NO to stop download.
@@ -88,7 +88,7 @@ FOUNDATION_EXPORT UIImage * _Nullable SDImageLoaderDecodeProgressiveImageData(NS
 
 
 /**
- Whether the error from image loader should be marked indded un-recoverable or not.
+ Whether the error from image loader should be marked indeed un-recoverable or not.
  If this return YES, failed URL which does not using `SDWebImageRetryFailed` will be blocked into black list. Else not.
 
  @param url The URL represent the image. Note this may not be a HTTP URL

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDImageLoadersManager.h

@@ -31,7 +31,7 @@
 - (void)addLoader:(nonnull id<SDImageLoader>)loader;
 
 /**
- Remove a image loader in the loaders array.
+ Remove an image loader in the loaders array.
  
  @param loader loader
  */

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDImageTransformer.h

@@ -59,7 +59,7 @@ FOUNDATION_EXPORT NSString * _Nullable SDThumbnailedKeyForKey(NSString * _Nullab
 
 /**
  Pipeline transformer. Which you can bind multiple transformers together to let the image to be transformed one by one in order and generate the final image.
- @note Because transformers are lightweight, if you want to append or arrange transfomers, create another pipeline transformer instead. This class is considered as immutable.
+ @note Because transformers are lightweight, if you want to append or arrange transformers, create another pipeline transformer instead. This class is considered as immutable.
  */
 @interface SDImagePipelineTransformer : NSObject <SDImageTransformer>
 

+ 10 - 9
Pods/SDWebImage/SDWebImage/Core/SDWebImageDefine.h

@@ -28,7 +28,7 @@ FOUNDATION_EXPORT CGFloat SDImageScaleFactorForKey(NSString * _Nullable key);
 /**
  Scale the image with the scale factor for the specify key. If no need to scale, return the original image.
  This works for `UIImage`(UIKit) or `NSImage`(AppKit). And this function also preserve the associated value in `UIImage+Metadata.h`.
- @note This is actually a convenience function, which firstlly call `SDImageScaleFactorForKey` and then call `SDScaledImageForScaleFactor`, kept for backward compatibility.
+ @note This is actually a convenience function, which firstly call `SDImageScaleFactorForKey` and then call `SDScaledImageForScaleFactor`, kept for backward compatibility.
 
  @param key The image cache key
  @param image The image
@@ -160,7 +160,8 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) {
     SDWebImageFromLoaderOnly = 1 << 16,
     
     /**
-     * By default, when you use `SDWebImageTransition` to do some view transition after the image load finished, this transition is only applied for image download from the network. This mask can force to apply view transition for memory and disk cache as well.
+     * By default, when you use `SDWebImageTransition` to do some view transition after the image load finished, this transition is only applied for image when the callback from manager is asynchronous (from network, or disk cache query)
+     * This mask can force to apply view transition for any cases, like memory cache query, or sync disk cache query.
      */
     SDWebImageForceTransition = 1 << 17,
     
@@ -171,7 +172,7 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) {
     SDWebImageAvoidDecodeImage = 1 << 18,
     
     /**
-     * By default, we decode the animated image. This flag can force decode the first frame only and produece the static image.
+     * By default, we decode the animated image. This flag can force decode the first frame only and produce the static image.
      */
     SDWebImageDecodeFirstFrameOnly = 1 << 19,
     
@@ -190,7 +191,7 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) {
     
     /**
      * By default, when we load the image from network, the image will be written to the cache (memory and disk, controlled by your `storeCacheType` context option)
-     * This maybe an asynchronously operation and the final `SDInternalCompletionBlock` callback does not gurantee the disk cache written is finished and may cause logic error. (For example, you modify the disk data just in completion block, however, the disk cache is not ready)
+     * This maybe an asynchronously operation and the final `SDInternalCompletionBlock` callback does not guarantee the disk cache written is finished and may cause logic error. (For example, you modify the disk data just in completion block, however, the disk cache is not ready)
      * If you need to process with the disk cache in the completion block, you should use this option to ensure the disk cache already been written when callback.
      * Note if you use this when using the custom cache serializer, or using the transformer, we will also wait until the output image data written is finished.
      */
@@ -200,7 +201,7 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) {
      * We usually don't apply transform on vector images, because vector images supports dynamically changing to any size, rasterize to a fixed size will loss details. To modify vector images, you can process the vector data at runtime (such as modifying PDF tag / SVG element).
      * Use this flag to transform them anyway.
      */
-    SDWebImageTransformVectorImage = 1 << 23,
+    SDWebImageTransformVectorImage = 1 << 23
 };
 
 
@@ -213,24 +214,24 @@ FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextSetIma
 
 /**
  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 *)
- @deprecated Deprecated in the future. This context options can be replaced by other context option control like `.imageCache`, `.imageLoader`, `.imageTransofmer` (See below), which already matches all the properties in SDWebImageManager.
+ @deprecated Deprecated in the future. This context options can be replaced by other context option control like `.imageCache`, `.imageLoader`, `.imageTransformer` (See below), which already matches all the properties in SDWebImageManager.
  */
 FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextCustomManager API_DEPRECATED("Use individual context option like .imageCache, .imageLoader and .imageTransformer instead", macos(10.10, API_TO_BE_DEPRECATED), ios(8.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED));
 
 /**
- A id<SDImageCache> instance which conforms to `SDImageCache` protocol. It's used to override the image mananger's cache during the image loading pipeline.
+ A id<SDImageCache> instance which conforms to `SDImageCache` protocol. It's used to override the image manager's cache during the image loading pipeline.
  In other word, if you just want to specify a custom cache during image loading, you don't need to re-create a dummy SDWebImageManager instance with the cache. If not provided, use the image manager's cache (id<SDImageCache>)
  */
 FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextImageCache;
 
 /**
- A id<SDImageLoader> instance which conforms to `SDImageLoader` protocol. It's used to override the image mananger's loader during the image loading pipeline.
+ A id<SDImageLoader> instance which conforms to `SDImageLoader` protocol. It's used to override the image manager's loader during the image loading pipeline.
  In other word, if you just want to specify a custom loader during image loading, you don't need to re-create a dummy SDWebImageManager instance with the loader. If not provided, use the image manager's cache (id<SDImageLoader>)
 */
 FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextImageLoader;
 
 /**
- A id<SDImageCoder> instance which conforms to `SDImageCoder` protocol. It's used to override the default image codre for image decoding(including progressive) and encoding during the image loading process.
+ A id<SDImageCoder> instance which conforms to `SDImageCoder` protocol. It's used to override the default image coder for image decoding(including progressive) and encoding during the image loading process.
  If you use this context option, we will not always use `SDImageCodersManager.shared` to loop through all registered coders and find the suitable one. Instead, we will arbitrarily use the exact provided coder without extra checking (We may not call `canDecodeFromData:`).
  @note This is only useful for cases which you can ensure the loading url matches your coder, or you find it's too hard to write a common coder which can used for generic usage. This will bind the loading url with the coder logic, which is not always a good design, but possible. (id<SDImageCache>)
 */

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloader.h

@@ -78,7 +78,7 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) {
     SDWebImageDownloaderAvoidDecodeImage = 1 << 9,
     
     /**
-     * By default, we decode the animated image. This flag can force decode the first frame only and produece the static image.
+     * By default, we decode the animated image. This flag can force decode the first frame only and produce the static image.
      */
     SDWebImageDownloaderDecodeFirstFrameOnly = 1 << 10,
     

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderConfig.h

@@ -91,7 +91,7 @@ typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) {
 
 /**
  * Set password using for HTTP Basic authentication.
- * Defautls to nil.
+ * Defaults to nil.
  */
 @property (nonatomic, copy, nullable) NSString *password;
 

+ 2 - 2
Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderDecryptor.h

@@ -17,9 +17,9 @@ We can use a block to specify the downloader decryptor. But Using protocol can m
 */
 @protocol SDWebImageDownloaderDecryptor <NSObject>
 
-/// Decrypt the original download data and return a new data. You can use this to decrypt the data using your perfereed algorithm.
+/// Decrypt the original download data and return a new data. You can use this to decrypt the data using your preferred algorithm.
 /// @param data The original download data
-/// @param response The URL response for data. If you modifiy the original URL response via response modifier, the modified version will be here. This arg is nullable.
+/// @param response The URL response for data. If you modify the original URL response via response modifier, the modified version will be here. This arg is nullable.
 /// @note If nil is returned, the image download will be marked as failed with error `SDWebImageErrorBadImageData`
 - (nullable NSData *)decryptedDataWithData:(nonnull NSData *)data response:(nullable NSURLResponse *)response;
 

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.h

@@ -65,7 +65,7 @@
 
 /**
  * The collected metrics from `-URLSession:task:didFinishCollectingMetrics:`.
- * This can be used to collect the network metrics like download duration, DNS lookup duration, SSL handshake dureation, etc. See Apple's documentation: https://developer.apple.com/documentation/foundation/urlsessiontaskmetrics
+ * This can be used to collect the network metrics like download duration, DNS lookup duration, SSL handshake duration, etc. See Apple's documentation: https://developer.apple.com/documentation/foundation/urlsessiontaskmetrics
  */
 @property (strong, nonatomic, readonly, nullable) NSURLSessionTaskMetrics *metrics API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 

+ 2 - 2
Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderOperation.m

@@ -41,7 +41,7 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary;
 @property (strong, nonatomic, nullable) NSError *responseError;
 @property (assign, nonatomic) double previousProgress; // previous progress percent
 
-@property (strong, nonatomic, nullable) id<SDWebImageDownloaderResponseModifier> responseModifier; // modifiy original URLResponse
+@property (strong, nonatomic, nullable) id<SDWebImageDownloaderResponseModifier> responseModifier; // modify original URLResponse
 @property (strong, nonatomic, nullable) id<SDWebImageDownloaderDecryptor> decryptor; // decrypt image data
 
 // This is weak because it is injected by whoever manages this session. If this gets nil-ed out, we won't be able to run
@@ -390,7 +390,7 @@ didReceiveResponse:(NSURLResponse *)response
         // Get the image data
         NSData *imageData = [self.imageData copy];
         
-        // keep maxmium one progressive decode process during download
+        // keep maximum one progressive decode process during download
         if (self.coderQueue.operationCount == 0) {
             // NSOperation have autoreleasepool, don't need to create extra one
             [self.coderQueue addOperationWithBlock:^{

+ 2 - 2
Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.h

@@ -50,7 +50,7 @@ A convenient request modifier to provide the HTTP request including HTTP Method,
 - (nonnull instancetype)initWithMethod:(nullable NSString *)method;
 
 /// Create the request modifier with HTTP Headers.
-/// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will overide the same fileds from original request.
+/// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will override the same fields from original request.
 /// @note This is for convenience, if you need code to control the logic, use block API instead.
 - (nonnull instancetype)initWithHeaders:(nullable NSDictionary<NSString *, NSString *> *)headers;
 
@@ -61,7 +61,7 @@ A convenient request modifier to provide the HTTP request including HTTP Method,
 
 /// Create the request modifier with HTTP Method, Headers and Body.
 /// @param method HTTP Method, nil means to GET.
-/// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will overide the same fileds from original request.
+/// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will override the same fields from original request.
 /// @param body HTTP Body.
 /// @note This is for convenience, if you need code to control the logic, use block API instead.
 - (nonnull instancetype)initWithMethod:(nullable NSString *)method headers:(nullable NSDictionary<NSString *, NSString *> *)headers body:(nullable NSData *)body;

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderRequestModifier.m

@@ -53,7 +53,7 @@
 }
 
 - (instancetype)initWithMethod:(NSString *)method headers:(NSDictionary<NSString *,NSString *> *)headers body:(NSData *)body {
-    method = [method copy];
+    method = method ? [method copy] : @"GET";
     headers = [headers copy];
     body = [body copy];
     return [self initWithBlock:^NSURLRequest * _Nullable(NSURLRequest * _Nonnull request) {

+ 2 - 2
Pods/SDWebImage/SDWebImage/Core/SDWebImageDownloaderResponseModifier.h

@@ -55,14 +55,14 @@ A convenient response modifier to provide the HTTP response including HTTP Statu
 - (nonnull instancetype)initWithVersion:(nullable NSString *)version;
 
 /// Create the response modifier with HTTP Headers. Status code defaults to 200.
-/// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will overide the same fileds from original response.
+/// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will override the same fields from original response.
 /// @note This is for convenience, if you need code to control the logic, use block API instead.
 - (nonnull instancetype)initWithHeaders:(nullable NSDictionary<NSString *, NSString *> *)headers;
 
 /// Create the response modifier with HTTP Status Code, Version and Headers.
 /// @param statusCode HTTP Status Code.
 /// @param version HTTP Version, nil means "HTTP/1.1".
-/// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will overide the same fileds from original response.
+/// @param headers HTTP Headers. Case insensitive according to HTTP/1.1(HTTP/2) standard. The headers will override the same fields from original response.
 /// @note This is for convenience, if you need code to control the logic, use block API instead.
 - (nonnull instancetype)initWithStatusCode:(NSInteger)statusCode version:(nullable NSString *)version headers:(nullable NSDictionary<NSString *, NSString *> *)headers;
 

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDWebImageError.h

@@ -19,7 +19,7 @@ typedef NS_ERROR_ENUM(SDWebImageErrorDomain, SDWebImageError) {
     SDWebImageErrorInvalidURL = 1000, // The URL is invalid, such as nil URL or corrupted URL
     SDWebImageErrorBadImageData = 1001, // The image data can not be decoded to image, or the image data is empty
     SDWebImageErrorCacheNotModified = 1002, // The remote location specify that the cached image is not modified, such as the HTTP response 304 code. It's useful for `SDWebImageRefreshCached`
-    SDWebImageErrorBlackListed = 1003, // The URL is blacklisted because of unrecoverable failsure marked by downloader (such as 404), you can use `.retryFailed` option to avoid this
+    SDWebImageErrorBlackListed = 1003, // The URL is blacklisted because of unrecoverable failure marked by downloader (such as 404), you can use `.retryFailed` option to avoid this
     SDWebImageErrorInvalidDownloadOperation = 2000, // The image download operation is invalid, such as nil operation or unexpected error occur when operation initialized
     SDWebImageErrorInvalidDownloadStatusCode = 2001, // The image download response a invalid status code. You can check the status code in error's userInfo under `SDWebImageErrorDownloadStatusCodeKey`
     SDWebImageErrorCancelled = 2002, // The image loading operation is cancelled before finished, during either async disk cache query, or waiting before actual network request. For actual network request error, check `NSURLErrorDomain` error domain and code.

+ 4 - 4
Pods/SDWebImage/SDWebImage/Core/SDWebImageManager.h

@@ -98,7 +98,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
 @interface SDWebImageManager : NSObject
 
 /**
- * The delegate for manager. Defatuls to nil.
+ * The delegate for manager. Defaults to nil.
  */
 @property (weak, nonatomic, nullable) id <SDWebImageManagerDelegate> delegate;
 
@@ -136,8 +136,8 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
 
 /**
  * The cache serializer is used to convert the decoded image, the source downloaded data, to the actual data used for storing to the disk cache. If you return nil, means to generate the data from the image instance, see `SDImageCache`.
- * For example, if you are using WebP images and facing the slow decoding time issue when later retriving from disk cache again. You can try to encode the decoded image to JPEG/PNG format to disk cache instead of source downloaded data.
- * @note The `image` arg is nonnull, but when you also provide a image transformer and the image is transformed, the `data` arg may be nil, take attention to this case.
+ * For example, if you are using WebP images and facing the slow decoding time issue when later retrieving from disk cache again. You can try to encode the decoded image to JPEG/PNG format to disk cache instead of source downloaded data.
+ * @note The `image` arg is nonnull, but when you also provide an image transformer and the image is transformed, the `data` arg may be nil, take attention to this case.
  * @note This method is called from a global queue in order to not to block the main thread.
  * @code
  SDWebImageManager.sharedManager.cacheSerializer = [SDWebImageCacheSerializer cacheSerializerWithBlock:^NSData * _Nullable(UIImage * _Nonnull image, NSData * _Nullable data, NSURL * _Nullable imageURL) {
@@ -225,7 +225,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
  *   The forth parameter is an `SDImageCacheType` enum indicating if the image was retrieved from the local cache
  *   or from the memory cache or from the network.
  *
- *   The fith parameter is set to NO when the SDWebImageProgressiveLoad option is used and the image is
+ *   The fifth parameter is set to NO when the SDWebImageProgressiveLoad option is used and the image is
  *   downloading. This block is thus called repeatedly with a partial image. When image is fully downloaded, the
  *   block is called a last time with the full image and the last parameter set to YES.
  *

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/SDWebImageManager.m

@@ -279,7 +279,7 @@ static id<SDImageLoader> _defaultImageLoader;
                 [self safelyRemoveOperationFromRunning:operation];
                 return;
             } else if (context[SDWebImageContextImageTransformer] && !cachedImage) {
-                // Have a chance to quary original cache instead of downloading
+                // Have a chance to query original cache instead of downloading
                 [self callOriginalCacheProcessForOperation:operation url:url options:options context:context progress:progressBlock completed:completedBlock];
                 return;
             }

+ 3 - 3
Pods/SDWebImage/SDWebImage/Core/SDWebImagePrefetcher.h

@@ -92,7 +92,7 @@ typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls,
 @property (strong, nonatomic, nonnull) dispatch_queue_t delegateQueue;
 
 /**
- * The delegate for the prefetcher. Defatuls to nil.
+ * The delegate for the prefetcher. Defaults to nil.
  */
 @property (weak, nonatomic, nullable) id <SDWebImagePrefetcherDelegate> delegate;
 
@@ -108,7 +108,7 @@ typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls,
 
 /**
  * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property.
- * Prefetching is seperate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls.
+ * Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls.
  * Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.
  *
  * @param urls list of URLs to prefetch
@@ -118,7 +118,7 @@ typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls,
 
 /**
  * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property.
- * Prefetching is seperate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls.
+ * Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls.
  * Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.
  *
  * @param urls            list of URLs to prefetch

+ 30 - 2
Pods/SDWebImage/SDWebImage/Core/SDWebImageTransition.h

@@ -46,7 +46,7 @@ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished);
 @interface SDWebImageTransition : NSObject
 
 /**
- By default, we set the image to the view at the beginning of the animtions. You can disable this and provide custom set image process
+ By default, we set the image to the view at the beginning of the animations. You can disable this and provide custom set image process
  */
 @property (nonatomic, assign) BOOL avoidAutoSetImage;
 /**
@@ -83,7 +83,7 @@ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished);
  */
 @interface SDWebImageTransition (Conveniences)
 
-/// Fade transition.
+/// Fade-in transition.
 @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *fadeTransition;
 /// Flip from left transition.
 @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromLeftTransition;
@@ -98,6 +98,34 @@ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished);
 /// Curl down transition.
 @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlDownTransition;
 
+/// Fade-in transition with duration.
+/// @param duration transition duration, use ease-in-out
++ (nonnull instancetype)fadeTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(fade(duration:));
+
+/// Flip from left  transition with duration.
+/// @param duration transition duration, use ease-in-out
++ (nonnull instancetype)flipFromLeftTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(flipFromLeft(duration:));
+
+/// Flip from right transition with duration.
+/// @param duration transition duration, use ease-in-out
++ (nonnull instancetype)flipFromRightTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(flipFromRight(duration:));
+
+/// Flip from top transition with duration.
+/// @param duration transition duration, use ease-in-out
++ (nonnull instancetype)flipFromTopTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(flipFromTop(duration:));
+
+/// Flip from bottom transition with duration.
+/// @param duration transition duration, use ease-in-out
++ (nonnull instancetype)flipFromBottomTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(flipFromBottom(duration:));
+
+///  Curl up transition with duration.
+/// @param duration transition duration, use ease-in-out
++ (nonnull instancetype)curlUpTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(curlUp(duration:));
+
+/// Curl down transition with duration.
+/// @param duration transition duration, use ease-in-out
++ (nonnull instancetype)curlDownTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(curlDown(duration:));
+
 @end
 
 #endif

+ 29 - 0
Pods/SDWebImage/SDWebImage/Core/SDWebImageTransition.m

@@ -84,6 +84,10 @@ CATransition * SDTransitionFromAnimationOptions(SDWebImageAnimationOptions optio
 @implementation SDWebImageTransition (Conveniences)
 
 + (SDWebImageTransition *)fadeTransition {
+    return [self fadeTransitionWithDuration:0.5];
+}
+
++ (SDWebImageTransition *)fadeTransitionWithDuration:(NSTimeInterval)duration {
     SDWebImageTransition *transition = [SDWebImageTransition new];
 #if SD_UIKIT
     transition.animationOptions = UIViewAnimationOptionTransitionCrossDissolve | UIViewAnimationOptionAllowUserInteraction;
@@ -94,6 +98,10 @@ CATransition * SDTransitionFromAnimationOptions(SDWebImageAnimationOptions optio
 }
 
 + (SDWebImageTransition *)flipFromLeftTransition {
+    return [self flipFromLeftTransitionWithDuration:0.5];
+}
+
++ (SDWebImageTransition *)flipFromLeftTransitionWithDuration:(NSTimeInterval)duration {
     SDWebImageTransition *transition = [SDWebImageTransition new];
 #if SD_UIKIT
     transition.animationOptions = UIViewAnimationOptionTransitionFlipFromLeft | UIViewAnimationOptionAllowUserInteraction;
@@ -104,6 +112,10 @@ CATransition * SDTransitionFromAnimationOptions(SDWebImageAnimationOptions optio
 }
 
 + (SDWebImageTransition *)flipFromRightTransition {
+    return [self flipFromRightTransitionWithDuration:0.5];
+}
+
++ (SDWebImageTransition *)flipFromRightTransitionWithDuration:(NSTimeInterval)duration {
     SDWebImageTransition *transition = [SDWebImageTransition new];
 #if SD_UIKIT
     transition.animationOptions = UIViewAnimationOptionTransitionFlipFromRight | UIViewAnimationOptionAllowUserInteraction;
@@ -114,6 +126,10 @@ CATransition * SDTransitionFromAnimationOptions(SDWebImageAnimationOptions optio
 }
 
 + (SDWebImageTransition *)flipFromTopTransition {
+    return [self flipFromTopTransitionWithDuration:0.5];
+}
+
++ (SDWebImageTransition *)flipFromTopTransitionWithDuration:(NSTimeInterval)duration {
     SDWebImageTransition *transition = [SDWebImageTransition new];
 #if SD_UIKIT
     transition.animationOptions = UIViewAnimationOptionTransitionFlipFromTop | UIViewAnimationOptionAllowUserInteraction;
@@ -124,6 +140,10 @@ CATransition * SDTransitionFromAnimationOptions(SDWebImageAnimationOptions optio
 }
 
 + (SDWebImageTransition *)flipFromBottomTransition {
+    return [self flipFromBottomTransitionWithDuration:0.5];
+}
+
++ (SDWebImageTransition *)flipFromBottomTransitionWithDuration:(NSTimeInterval)duration {
     SDWebImageTransition *transition = [SDWebImageTransition new];
 #if SD_UIKIT
     transition.animationOptions = UIViewAnimationOptionTransitionFlipFromBottom | UIViewAnimationOptionAllowUserInteraction;
@@ -134,6 +154,10 @@ CATransition * SDTransitionFromAnimationOptions(SDWebImageAnimationOptions optio
 }
 
 + (SDWebImageTransition *)curlUpTransition {
+    return [self curlUpTransitionWithDuration:0.5];
+}
+
++ (SDWebImageTransition *)curlUpTransitionWithDuration:(NSTimeInterval)duration {
     SDWebImageTransition *transition = [SDWebImageTransition new];
 #if SD_UIKIT
     transition.animationOptions = UIViewAnimationOptionTransitionCurlUp | UIViewAnimationOptionAllowUserInteraction;
@@ -144,12 +168,17 @@ CATransition * SDTransitionFromAnimationOptions(SDWebImageAnimationOptions optio
 }
 
 + (SDWebImageTransition *)curlDownTransition {
+    return [self curlDownTransitionWithDuration:0.5];
+}
+
++ (SDWebImageTransition *)curlDownTransitionWithDuration:(NSTimeInterval)duration {
     SDWebImageTransition *transition = [SDWebImageTransition new];
 #if SD_UIKIT
     transition.animationOptions = UIViewAnimationOptionTransitionCurlDown | UIViewAnimationOptionAllowUserInteraction;
 #else
     transition.animationOptions = SDWebImageAnimationOptionTransitionCurlDown;
 #endif
+    transition.duration = duration;
     return transition;
 }
 

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/UIImage+GIF.h

@@ -10,7 +10,7 @@
 #import "SDWebImageCompat.h"
 
 /**
- This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directlly use `SDImageCoder`.
+ This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directly use `SDImageCoder`.
  */
 @interface UIImage (GIF)
 

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/UIImage+MemoryCacheCost.h

@@ -17,7 +17,7 @@
  The memory cache cost for specify image used by image cache. The cost function is the bytes size 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 bytes size when `image.images` is nil for static image. Retuen full frame bytes size when `image.images` is not nil for animated image.
+ For `UIImage`, this method return the single frame bytes size when `image.images` is nil for static image. Return full frame bytes size when `image.images` is not nil for animated image.
  For `NSImage`, this method return the single frame bytes size because `NSImage` does not store all frames in memory.
  @note Note that because of the limitations of category this property can get out of sync if you create another instance with CGImage or other methods.
  @note For custom animated class conforms to `SDAnimatedImage`, you can override this getter method in your subclass to return a more proper value instead, which representing the current frame's total bytes.

+ 1 - 0
Pods/SDWebImage/SDWebImage/Core/UIImage+MultiFormat.h

@@ -45,6 +45,7 @@
 /**
  Encode the current image to the data, the image format is unspecified
 
+ @note If the receiver is `SDAnimatedImage`, this will return the animated image data if available. No more extra encoding process.
  @return The encoded data. If can't encode, return nil
  */
 - (nullable NSData *)sd_imageData;

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/UIImage+Transform.h

@@ -27,7 +27,7 @@ typedef NS_OPTIONS(NSUInteger, SDRectCorner) {
 #endif
 
 /**
- Provide some commen method for `UIImage`.
+ Provide some common method for `UIImage`.
  Image process is based on Core Graphics and vImage.
  */
 @interface UIImage (Transform)

+ 6 - 5
Pods/SDWebImage/SDWebImage/Core/UIView+WebCache.h

@@ -34,15 +34,16 @@ typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable ima
 /**
  * Get the current image operation key. Operation key is used to identify the different queries for one view instance (like UIButton).
  * See more about this in `SDWebImageContextSetImageOperationKey`.
- * @note You can use method `UIView+WebCacheOperation` to invesigate different queries' operation.
+ * If you cancel current image load, the key will be set to nil.
+ * @note You can use method `UIView+WebCacheOperation` to investigate different queries' operation.
  */
 @property (nonatomic, strong, readonly, nullable) NSString *sd_latestOperationKey;
 
 /**
  * The current image loading progress associated to the view. The unit count is the received size and excepted size of download.
  * The `totalUnitCount` and `completedUnitCount` will be reset to 0 after a new image loading start (change from current queue). And they will be set to `SDWebImageProgressUnitCountUnknown` if the progressBlock not been called but the image loading success to mark the progress finished (change from main queue).
- * @note You can use Key-Value Observing on the progress, but you should take care that the change to progress is from a background queue during download(the same as progressBlock). If you want to using KVO and update the UI, make sure to dispatch on the main queue. And it's recommand to use some KVO libs like KVOController because it's more safe and easy to use.
- * @note The getter will create a progress instance if the value is nil. But by default, we don't create one. If you need to use Key-Value Observing, you must trigger the getter or set a custom progresss instance before the loading start. The default value is nil.
+ * @note You can use Key-Value Observing on the progress, but you should take care that the change to progress is from a background queue during download(the same as progressBlock). If you want to using KVO and update the UI, make sure to dispatch on the main queue. And it's recommend to use some KVO libs like KVOController because it's more safe and easy to use.
+ * @note The getter will create a progress instance if the value is nil. But by default, we don't create one. If you need to use Key-Value Observing, you must trigger the getter or set a custom progress instance before the loading start. The default value is nil.
  * @note Note that because of the limitations of categories this property can get out of sync if you update the progress directly.
  */
 @property (nonatomic, strong, null_resettable) NSProgress *sd_imageProgress;
@@ -66,7 +67,7 @@ typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable ima
  *   The forth parameter is an `SDImageCacheType` enum indicating if the image was retrieved from the local cache
  *   or from the memory cache or from the network.
  *
- *   The fith parameter normally is always YES. However, if you provide SDWebImageAvoidAutoSetImage with SDWebImageProgressiveLoad options to enable progressive downloading and set the image yourself. This block is thus called repeatedly with a partial image. When image is fully downloaded, the
+ *   The fifth parameter normally is always YES. However, if you provide SDWebImageAvoidAutoSetImage with SDWebImageProgressiveLoad options to enable progressive downloading and set the image yourself. This block is thus called repeatedly with a partial image. When image is fully downloaded, the
  *   block is called a last time with the full image and the last parameter set to YES.
  *
  *   The last parameter is the original image URL
@@ -90,7 +91,7 @@ typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable ima
 
 /**
  The image transition when image load finished. See `SDWebImageTransition`.
- If you specify nil, do not do transition. Defautls to nil.
+ If you specify nil, do not do transition. Defaults to nil.
  */
 @property (nonatomic, strong, nullable) SDWebImageTransition *sd_imageTransition;
 

+ 50 - 5
Pods/SDWebImage/SDWebImage/Core/UIView+WebCache.m

@@ -174,7 +174,29 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL;
 #if SD_UIKIT || SD_MAC
             // check whether we should use the image transition
             SDWebImageTransition *transition = nil;
-            if (finished && (options & SDWebImageForceTransition || cacheType == SDImageCacheTypeNone)) {
+            BOOL shouldUseTransition = NO;
+            if (options & SDWebImageForceTransition) {
+                // Always
+                shouldUseTransition = YES;
+            } else if (cacheType == SDImageCacheTypeNone) {
+                // From network
+                shouldUseTransition = YES;
+            } else {
+                // From disk (and, user don't use sync query)
+                if (cacheType == SDImageCacheTypeMemory) {
+                    shouldUseTransition = NO;
+                } else if (cacheType == SDImageCacheTypeDisk) {
+                    if (options & SDWebImageQueryMemoryDataSync || options & SDWebImageQueryDiskDataSync) {
+                        shouldUseTransition = NO;
+                    } else {
+                        shouldUseTransition = YES;
+                    }
+                } else {
+                    // Not valid cache type, fallback
+                    shouldUseTransition = NO;
+                }
+            }
+            if (finished && shouldUseTransition) {
                 transition = self.sd_imageTransition;
             }
 #endif
@@ -203,6 +225,7 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL;
 
 - (void)sd_cancelCurrentImageLoad {
     [self sd_cancelImageLoadOperationWithKey:self.sd_latestOperationKey];
+    self.sd_latestOperationKey = nil;
 }
 
 - (void)sd_setImage:(UIImage *)image imageData:(NSData *)imageData basedOnClassOrViaCustomSetImageBlock:(SDSetImageBlock)setImageBlock cacheType:(SDImageCacheType)cacheType imageURL:(NSURL *)imageURL {
@@ -251,22 +274,38 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL;
     if (transition) {
 #if SD_UIKIT
         [UIView transitionWithView:view duration:0 options:0 animations:^{
+            if (!view.sd_latestOperationKey) {
+                return;
+            }
             // 0 duration to let UIKit render placeholder and prepares block
             if (transition.prepares) {
                 transition.prepares(view, image, imageData, cacheType, imageURL);
             }
         } completion:^(BOOL finished) {
             [UIView transitionWithView:view duration:transition.duration options:transition.animationOptions animations:^{
+                if (!view.sd_latestOperationKey) {
+                    return;
+                }
                 if (finalSetImageBlock && !transition.avoidAutoSetImage) {
                     finalSetImageBlock(image, imageData, cacheType, imageURL);
                 }
                 if (transition.animations) {
                     transition.animations(view, image);
                 }
-            } completion:transition.completion];
+            } completion:^(BOOL finished) {
+                if (!view.sd_latestOperationKey) {
+                    return;
+                }
+                if (transition.completion) {
+                    transition.completion(finished);
+                }
+            }];
         }];
 #elif SD_MAC
         [NSAnimationContext runAnimationGroup:^(NSAnimationContext * _Nonnull prepareContext) {
+            if (!view.sd_latestOperationKey) {
+                return;
+            }
             // 0 duration to let AppKit render placeholder and prepares block
             prepareContext.duration = 0;
             if (transition.prepares) {
@@ -274,11 +313,14 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL;
             }
         } completionHandler:^{
             [NSAnimationContext runAnimationGroup:^(NSAnimationContext * _Nonnull context) {
+                if (!view.sd_latestOperationKey) {
+                    return;
+                }
                 context.duration = transition.duration;
-                #pragma clang diagnostic push
-                #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
                 CAMediaTimingFunction *timingFunction = transition.timingFunction;
-                #pragma clang diagnostic pop
+#pragma clang diagnostic pop
                 if (!timingFunction) {
                     timingFunction = SDTimingFunctionFromAnimationOptions(transition.animationOptions);
                 }
@@ -295,6 +337,9 @@ const int64_t SDWebImageProgressUnitCountUnknown = 1LL;
                     transition.animations(view, image);
                 }
             } completionHandler:^{
+                if (!view.sd_latestOperationKey) {
+                    return;
+                }
                 if (transition.completion) {
                     transition.completion(YES);
                 }

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.h

@@ -11,7 +11,7 @@
 
 /**
  These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external.
- All the stored operations are weak, so it will be dalloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them.
+ All the stored operations are weak, so it will be dealloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them.
  */
 @interface UIView (WebCacheOperation)
 

+ 1 - 1
Pods/SDWebImage/SDWebImage/Core/UIView+WebCacheOperation.m

@@ -12,7 +12,7 @@
 static char loadOperationKey;
 
 // key is strong, value is weak because operation instance is retained by SDWebImageManager's runningOperations property
-// we should use lock to keep thread-safe because these method may not be acessed from main queue
+// we should use lock to keep thread-safe because these method may not be accessed from main queue
 typedef NSMapTable<NSString *, id<SDWebImageOperation>> SDOperationsDictionary;
 
 @implementation UIView (WebCacheOperation)

+ 0 - 25
Pods/SDWebImage/SDWebImage/Private/SDImageHEICCoderInternal.h

@@ -1,25 +0,0 @@
-/*
-* This file is part of the SDWebImage package.
-* (c) Olivier Poitrey <rs@dailymotion.com>
-*
-* For the full copyright and license information, please view the LICENSE
-* file that was distributed with this source code.
-*/
-
-#import <Foundation/Foundation.h>
-#import "SDImageHEICCoder.h"
-
-// AVFileTypeHEIC/AVFileTypeHEIF is defined in AVFoundation via iOS 11, we use this without import AVFoundation
-#define kSDUTTypeHEIC ((__bridge CFStringRef)@"public.heic")
-#define kSDUTTypeHEIF ((__bridge CFStringRef)@"public.heif")
-// HEIC Sequence (Animated Image)
-#define kSDUTTypeHEICS ((__bridge CFStringRef)@"public.heics")
-
-@interface SDImageHEICCoder ()
-
-+ (BOOL)canDecodeFromHEICFormat;
-+ (BOOL)canDecodeFromHEIFFormat;
-+ (BOOL)canEncodeToHEICFormat;
-+ (BOOL)canEncodeToHEIFFormat;
-
-@end

+ 10 - 0
Pods/SDWebImage/SDWebImage/Private/SDImageIOAnimatedCoderInternal.h

@@ -9,10 +9,20 @@
 #import <Foundation/Foundation.h>
 #import "SDImageIOAnimatedCoder.h"
 
+// AVFileTypeHEIC/AVFileTypeHEIF is defined in AVFoundation via iOS 11, we use this without import AVFoundation
+#define kSDUTTypeHEIC ((__bridge CFStringRef)@"public.heic")
+#define kSDUTTypeHEIF ((__bridge CFStringRef)@"public.heif")
+// HEIC Sequence (Animated Image)
+#define kSDUTTypeHEICS ((__bridge CFStringRef)@"public.heics")
+// kUTTypeWebP seems not defined in public UTI framework, Apple use the hardcode string, we define them :)
+#define kSDUTTypeWebP ((__bridge CFStringRef)@"org.webmproject.webp")
+
 @interface SDImageIOAnimatedCoder ()
 
 + (NSTimeInterval)frameDurationAtIndex:(NSUInteger)index source:(nonnull CGImageSourceRef)source;
 + (NSUInteger)imageLoopCountWithSource:(nonnull CGImageSourceRef)source;
 + (nullable UIImage *)createFrameAtIndex:(NSUInteger)index source:(nonnull CGImageSourceRef)source scale:(CGFloat)scale preserveAspectRatio:(BOOL)preserveAspectRatio thumbnailSize:(CGSize)thumbnailSize options:(nullable NSDictionary *)options;
++ (BOOL)canEncodeToFormat:(SDImageFormat)format;
++ (BOOL)canDecodeFromFormat:(SDImageFormat)format;
 
 @end

+ 1 - 0
Pods/SDWebImage/WebImage/SDWebImage.h

@@ -70,6 +70,7 @@ FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[];
 #import <SDWebImage/SDWebImageOptionsProcessor.h>
 #import <SDWebImage/SDImageIOAnimatedCoder.h>
 #import <SDWebImage/SDImageHEICCoder.h>
+#import <SDWebImage/SDImageAWebPCoder.h>
 
 // Mac
 #if __has_include(<SDWebImage/NSImage+Compatibility.h>)

+ 1 - 1
Pods/Target Support Files/Pods-deltachat-ios-DcShare/Pods-deltachat-ios-DcShare-acknowledgements.markdown

@@ -102,7 +102,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 ## SDWebImage
 
-Copyright (c) 2009-2018 Olivier Poitrey rs@dailymotion.com
+Copyright (c) 2009-2020 Olivier Poitrey rs@dailymotion.com
  
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Pods/Target Support Files/Pods-deltachat-ios-DcShare/Pods-deltachat-ios-DcShare-acknowledgements.plist

@@ -137,7 +137,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 		</dict>
 		<dict>
 			<key>FooterText</key>
-			<string>Copyright (c) 2009-2018 Olivier Poitrey rs@dailymotion.com
+			<string>Copyright (c) 2009-2020 Olivier Poitrey rs@dailymotion.com
  
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Pods/Target Support Files/Pods-deltachat-ios/Pods-deltachat-ios-acknowledgements.markdown

@@ -102,7 +102,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 ## SDWebImage
 
-Copyright (c) 2009-2018 Olivier Poitrey rs@dailymotion.com
+Copyright (c) 2009-2020 Olivier Poitrey rs@dailymotion.com
  
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Pods/Target Support Files/Pods-deltachat-ios/Pods-deltachat-ios-acknowledgements.plist

@@ -137,7 +137,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 		</dict>
 		<dict>
 			<key>FooterText</key>
-			<string>Copyright (c) 2009-2018 Olivier Poitrey rs@dailymotion.com
+			<string>Copyright (c) 2009-2020 Olivier Poitrey rs@dailymotion.com
  
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
Pods/Target Support Files/SDWebImage/SDWebImage-Info.plist

@@ -15,7 +15,7 @@
   <key>CFBundlePackageType</key>
   <string>FMWK</string>
   <key>CFBundleShortVersionString</key>
-  <string>5.8.0</string>
+  <string>5.9.1</string>
   <key>CFBundleSignature</key>
   <string>????</string>
   <key>CFBundleVersion</key>

+ 1 - 0
Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h

@@ -21,6 +21,7 @@
 #import "SDDiskCache.h"
 #import "SDGraphicsImageRenderer.h"
 #import "SDImageAPNGCoder.h"
+#import "SDImageAWebPCoder.h"
 #import "SDImageCache.h"
 #import "SDImageCacheConfig.h"
 #import "SDImageCacheDefine.h"

+ 13 - 0
Pods/Target Support Files/SDWebImage/SDWebImage.debug.xcconfig

@@ -0,0 +1,13 @@
+APPLICATION_EXTENSION_API_ONLY = YES
+CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage
+DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+OTHER_LDFLAGS = $(inherited) -framework "ImageIO"
+PODS_BUILD_DIR = ${BUILD_DIR}
+PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
+PODS_ROOT = ${SRCROOT}
+PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage
+PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
+SKIP_INSTALL = YES
+SUPPORTS_MACCATALYST = YES
+USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

+ 13 - 0
Pods/Target Support Files/SDWebImage/SDWebImage.release.xcconfig

@@ -0,0 +1,13 @@
+APPLICATION_EXTENSION_API_ONLY = YES
+CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage
+DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO
+GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
+OTHER_LDFLAGS = $(inherited) -framework "ImageIO"
+PODS_BUILD_DIR = ${BUILD_DIR}
+PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
+PODS_ROOT = ${SRCROOT}
+PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage
+PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
+SKIP_INSTALL = YES
+SUPPORTS_MACCATALYST = YES
+USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

Some files were not shown because too many files changed in this diff