Przeglądaj źródła

Merge pull request #545 from onevcat/fix/image-orientation

Consider image orientation when applying filter
Wei Wang 9 lat temu
rodzic
commit
3353d58427
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      Sources/Filter.swift
  2. 1 1
      Sources/Image.swift

+ 1 - 1
Sources/Filter.swift

@@ -121,7 +121,7 @@ extension Kingfisher where Base: Image {
         #if os(macOS)
             return fixedForRetinaPixel(cgImage: result, to: size)
         #else
-            return Image(cgImage: result)
+            return Image(cgImage: result, scale: base.scale, orientation: base.imageOrientation)
         #endif
     }
 

+ 1 - 1
Sources/Image.swift

@@ -514,7 +514,7 @@ extension Kingfisher where Base: Image {
             #if os(macOS)
                 let result = outContext.makeImage().flatMap { fixedForRetinaPixel(cgImage: $0, to: size) }
             #else
-                let result = outContext.makeImage().flatMap { Image(cgImage: $0) }
+                let result = outContext.makeImage().flatMap { Image(cgImage: $0, scale: base.scale, orientation: base.imageOrientation) }
             #endif
             guard let blurredImage = result else {
                 assertionFailure("[Kingfisher] Can not make an blurred image within this context.")