Sfoglia il codice sorgente

Add some comment for future me

onevcat 6 anni fa
parent
commit
884595088a
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      Sources/SwiftUI/ImageBinder.swift

+ 5 - 0
Sources/SwiftUI/ImageBinder.swift

@@ -84,6 +84,11 @@ extension KFImage {
                         self.downloadTask = nil
                         self.downloadTask = nil
                         switch result {
                         switch result {
                         case .success(let value):
                         case .success(let value):
+                            // The normalized version of image is used to solve #1395
+                            // It should be not necessary if SwiftUI.Image can handle resizing correctly when created
+                            // by `Image.init(uiImage:)`. (The orientation information should be already contained in
+                            // a `UIImage`)
+                            // https://github.com/onevcat/Kingfisher/issues/1395
                             self.image = value.image.kf.normalized
                             self.image = value.image.kf.normalized
                             DispatchQueue.main.async {
                             DispatchQueue.main.async {
                                 self.onSuccessDelegate.call(value)
                                 self.onSuccessDelegate.call(value)