Browse Source

Identifier is used to identify the post-processed images in cache, so we need to keep the identifier the same for .none case

Kévin Renella 9 years ago
parent
commit
fe4e84dd71
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Sources/ImageProcessor.swift

+ 6 - 1
Sources/ImageProcessor.swift

@@ -191,7 +191,12 @@ public struct ResizingImageProcessor: ImageProcessor {
     public init(targetSize: CGSize, contentMode: ContentMode = .none) {
         self.targetSize = targetSize
         self.targetContentMode = contentMode
-        self.identifier = "com.onevcat.Kingfisher.ResizingImageProcessor(\(targetSize), \(targetContentMode))"
+        
+        if contentMode == .none {
+            self.identifier = "com.onevcat.Kingfisher.ResizingImageProcessor(\(targetSize))"
+        } else {
+            self.identifier = "com.onevcat.Kingfisher.ResizingImageProcessor(\(targetSize), \(contentMode))"
+        }
     }
     
     public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {