From 3209ce6cd991f8b35e49426b79422dbee0c72e6e Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Sat, 2 Mar 2019 15:30:32 -0500 Subject: [PATCH] Normalize images in the image editor. --- .../Views/ImageEditor/ImageEditorCanvasView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SignalMessaging/Views/ImageEditor/ImageEditorCanvasView.swift b/SignalMessaging/Views/ImageEditor/ImageEditorCanvasView.swift index 886adf2c7..dbe3448a3 100644 --- a/SignalMessaging/Views/ImageEditor/ImageEditorCanvasView.swift +++ b/SignalMessaging/Views/ImageEditor/ImageEditorCanvasView.swift @@ -160,7 +160,11 @@ public class ImageEditorCanvasView: UIView { owsFailDebug("Couldn't load background image.") return nil } - return srcImage + // We normalize the image orientation here for the sake + // of code simplicity. We could modify the image layer's + // transform to handle the normalization, which would + // have perf benefits. + return srcImage.normalized() } // MARK: - Content