From 9f3aeb63ac5be53122f54929777a49292a46cb48 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Fri, 24 May 2024 14:37:08 +0200 Subject: [PATCH] Fix orientation image --- Linphone/UI/Main/Conversations/Fragments/ChatBubbleView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Linphone/UI/Main/Conversations/Fragments/ChatBubbleView.swift b/Linphone/UI/Main/Conversations/Fragments/ChatBubbleView.swift index 9da8dc9a4..868c16330 100644 --- a/Linphone/UI/Main/Conversations/Fragments/ChatBubbleView.swift +++ b/Linphone/UI/Main/Conversations/Fragments/ChatBubbleView.swift @@ -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)