Fix orientation image

This commit is contained in:
Benoit Martins 2024-05-24 14:37:08 +02:00
parent 57c8efe310
commit 9f3aeb63ac

View file

@ -315,7 +315,8 @@ struct ChatBubbleView: View {
if let imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil) as Dictionary? {
let pixelWidth = imageProperties[kCGImagePropertyPixelWidth] as? CGFloat
let pixelHeight = imageProperties[kCGImagePropertyPixelHeight] as? CGFloat
return (pixelWidth ?? 0, pixelHeight ?? 0)
let orientation = imageProperties[kCGImagePropertyOrientation] as? Int
return orientation != nil && orientation == 6 ? (pixelHeight ?? 0, pixelWidth ?? 0) : (pixelWidth ?? 0, pixelHeight ?? 0)
}
}
return (0, 0)