Merge pull request #159 from SDWebImage/bugfix_ios14

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:41:50 +08:00 committed by GitHub
commit 7750264245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {