whw пре 9 година
родитељ
комит
6552660591
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      Sources/Image.swift

+ 4 - 4
Sources/Image.swift

@@ -501,7 +501,7 @@ extension Kingfisher where Base: Image {
                 return vImage_Buffer(data: data, height: height, width: width, rowBytes: rowBytes)
             }
 
-            guard let context = beginContext() else {
+            guard let context = beginContext(size: size) else {
                 assertionFailure("[Kingfisher] Failed to create CG context for blurring image.")
                 return base
             }
@@ -511,7 +511,7 @@ extension Kingfisher where Base: Image {
             
             var inBuffer = createEffectBuffer(context)
             
-            guard let outContext = beginContext() else {
+            guard let outContext = beginContext(size: size) else {
                 assertionFailure("[Kingfisher] Failed to create CG context for blurring image.")
                 return base
             }
@@ -627,7 +627,7 @@ extension Kingfisher where Base: Image {
             return base
         }
         let colorSpace = CGColorSpaceCreateDeviceRGB()
-        guard let context = beginContext() else {
+        guard let context = beginContext(size: CGSize(width: imageRef.width, height: imageRef.height)) else {
             assertionFailure("[Kingfisher] Decoding fails to create a valid context.")
             return base
         }
@@ -755,7 +755,7 @@ extension Comparable {
 
 extension Kingfisher where Base: Image {
     
-    func beginContext() -> CGContext? {
+    func beginContext(size: CGSize) -> CGContext? {
         #if os(macOS)
             guard let rep = NSBitmapImageRep(
                 bitmapDataPlanes: nil,