From 1ec2ecac11d429c25970fa336dbf7e4367ab0d15 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 13 Jan 2022 04:20:15 +0300 Subject: [PATCH] Fixed render of scene from photo editor for grayscaled images. Fixed #23889. --- Telegram/SourceFiles/editor/photo_editor_common.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Telegram/SourceFiles/editor/photo_editor_common.cpp b/Telegram/SourceFiles/editor/photo_editor_common.cpp index 4caa14e83c..e20266c1bd 100644 --- a/Telegram/SourceFiles/editor/photo_editor_common.cpp +++ b/Telegram/SourceFiles/editor/photo_editor_common.cpp @@ -18,6 +18,11 @@ QImage ImageModified(QImage image, const PhotoModifications &mods) { return image; } if (mods.paint) { + if (image.format() != QImage::Format_ARGB32_Premultiplied) { + image = image.convertToFormat( + QImage::Format_ARGB32_Premultiplied); + } + Painter p(&image); PainterHighQualityEnabler hq(p);