From 635752990143b58073df2be41b19ac3eb1256fe8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 20 Feb 2020 10:55:50 +0400 Subject: [PATCH] Fix 90/270 degrees photo rotation. Fixes #7197. --- .../SourceFiles/media/view/media_view_overlay_widget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index c82d7cae7..22c661655 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -2689,12 +2689,12 @@ void OverlayWidget::validatePhotoImage(Image *image, bool blurred) { } else if (!_staticContent.isNull() && (blurred || !_blurred)) { return; } - const auto w = _width * cIntRetinaFactor(); - const auto h = _height * cIntRetinaFactor(); + const auto use = flipSizeByRotation({ _width, _height }) + * cIntRetinaFactor(); _staticContent = image->pixNoCache( fileOrigin(), - w, - h, + use.width(), + use.height(), Images::Option::Smooth | (blurred ? Images::Option::Blurred : Images::Option(0))); _staticContent.setDevicePixelRatio(cRetinaFactor());