From 1c2ea8d84a05e92cd5a4e16bd82384095ee6a038 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 2 Dec 2021 16:03:07 +0400 Subject: [PATCH] Fix semi-transparent inline result thumbnails. --- .../inline_bot_layout_internal.cpp | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp index 583a9e0469..54b4b8ad99 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp @@ -322,7 +322,8 @@ void Gif::validateThumbnail( frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), (Images::Option::Smooth - | (good ? Images::Option::None : Images::Option::Blurred)), + | (good ? Images::Option::None : Images::Option::Blurred) + | Images::Option::TransparentBackground), size.width(), size.height()); } @@ -663,7 +664,9 @@ void Photo::validateThumbnail( _thumb = image->pixNoCache( frame.width() * cIntRetinaFactor(), frame.height() * cIntRetinaFactor(), - Images::Option::Smooth | (good ? Images::Option(0) : Images::Option::Blurred), + (Images::Option::Smooth + | (good ? Images::Option(0) : Images::Option::Blurred) + | Images::Option::TransparentBackground), size.width(), size.height()); _thumbGood = good; @@ -819,7 +822,12 @@ void Video::prepareThumbnail(QSize size) const { w = width; } } - _thumb = thumb->pixNoCache(w * cIntRetinaFactor(), h * cIntRetinaFactor(), Images::Option::Smooth, width, height); + _thumb = thumb->pixNoCache( + w * cIntRetinaFactor(), + h * cIntRetinaFactor(), + Images::Option::Smooth | Images::Option::TransparentBackground, + width, + height); } } @@ -1153,7 +1161,12 @@ void Contact::prepareThumbnail(int width, int height) const { w = width; } } - _thumb = thumb->pixNoCache(w * cIntRetinaFactor(), h * cIntRetinaFactor(), Images::Option::Smooth, width, height); + _thumb = thumb->pixNoCache( + w * cIntRetinaFactor(), + h * cIntRetinaFactor(), + Images::Option::Smooth | Images::Option::TransparentBackground, + width, + height); } Article::Article( @@ -1306,7 +1319,12 @@ void Article::prepareThumbnail(int width, int height) const { w = width; } } - _thumb = thumb->pixNoCache(w * cIntRetinaFactor(), h * cIntRetinaFactor(), Images::Option::Smooth, width, height); + _thumb = thumb->pixNoCache( + w * cIntRetinaFactor(), + h * cIntRetinaFactor(), + Images::Option::Smooth | Images::Option::TransparentBackground, + width, + height); } Game::Game(not_null context, not_null result) @@ -1524,7 +1542,8 @@ void Game::validateThumbnail(Image *image, QSize size, bool good) const { w * cIntRetinaFactor(), h * cIntRetinaFactor(), (Images::Option::Smooth - | (good ? Images::Option::None : Images::Option::Blurred)), + | (good ? Images::Option::None : Images::Option::Blurred) + | Images::Option::TransparentBackground), size.width(), size.height()); }