Remove the fix for EXIF image in WebImage, which is fixed by Apple in iOS 14

This commit is contained in:
DreamPiggy 2021-02-19 14:35:25 +08:00
parent 0c23726533
commit 5e9d0f3e3d
1 changed files with 10 additions and 4 deletions

View File

@ -149,10 +149,16 @@ public struct WebImage : View {
} else {
cgImage = image.cgImage
}
}
// Case 2: Image with EXIF orientation (only EXIF 5-8 contains bug)
else if [.left, .leftMirrored, .right, .rightMirrored].contains(image.imageOrientation) {
cgImage = image.cgImage
} else {
// Case 2: Image with EXIF orientation (only EXIF 5-8 contains bug)
if [.left, .leftMirrored, .right, .rightMirrored].contains(image.imageOrientation) {
// Fixed by Apple in iOS 14+
if #available(iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
// Do nothing
} else {
cgImage = image.cgImage
}
}
}
// If we have CGImage, use CGImage based API, else use UIImage based API
if let cgImage = cgImage {