Skip to content

Commit 5e9d0f3

Browse files
committed
Remove the fix for EXIF image in WebImage, which is fixed by Apple in iOS 14
1 parent 0c23726 commit 5e9d0f3

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

SDWebImageSwiftUI/Classes/WebImage.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,16 @@ public struct WebImage : View {
149149
} else {
150150
cgImage = image.cgImage
151151
}
152-
}
153-
// Case 2: Image with EXIF orientation (only EXIF 5-8 contains bug)
154-
else if [.left, .leftMirrored, .right, .rightMirrored].contains(image.imageOrientation) {
155-
cgImage = image.cgImage
152+
} else {
153+
// Case 2: Image with EXIF orientation (only EXIF 5-8 contains bug)
154+
if [.left, .leftMirrored, .right, .rightMirrored].contains(image.imageOrientation) {
155+
// Fixed by Apple in iOS 14+
156+
if #available(iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
157+
// Do nothing
158+
} else {
159+
cgImage = image.cgImage
160+
}
161+
}
156162
}
157163
// If we have CGImage, use CGImage based API, else use UIImage based API
158164
if let cgImage = cgImage {

0 commit comments

Comments
 (0)