From 42eb74d07a44c00bc84ddff1fc343a5978cd68be Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 16 Jul 2021 10:10:34 +0300 Subject: [PATCH] Version 2.8.9: Fix GIF caption edit. --- .../attach_item_single_media_preview.cpp | 19 ++++++++++++++++++- changelog.txt | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ui/chat/attach/attach_item_single_media_preview.cpp b/Telegram/SourceFiles/ui/chat/attach/attach_item_single_media_preview.cpp index cb90d2b04f..02751972aa 100644 --- a/Telegram/SourceFiles/ui/chat/attach/attach_item_single_media_preview.cpp +++ b/Telegram/SourceFiles/ui/chat/attach/attach_item_single_media_preview.cpp @@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "media/streaming/media_streaming_instance.h" #include "media/streaming/media_streaming_loader_local.h" #include "media/streaming/media_streaming_player.h" +#include "styles/style_boxes.h" namespace Ui { namespace { @@ -87,7 +88,23 @@ ItemSingleMediaPreview::ItemSingleMediaPreview( session->downloaderTaskFinished() ) | rpl::start_with_next([=] { const auto computed = computeThumbInfo(); - if (computed.loaded) { + if (!computed.image) { + if (_documentMedia && !_documentMedia->owner()->hasThumbnail()) { + const auto size = _documentMedia->owner()->dimensions.scaled( + st::sendMediaPreviewSize, + st::confirmMaxHeight, + Qt::KeepAspectRatio); + if (!size.isEmpty()) { + auto empty = QImage( + size, + QImage::Format_ARGB32_Premultiplied); + empty.fill(Qt::black); + preparePreview(empty); + } + _lifetimeDownload.destroy(); + } + return; + } else if (computed.loaded) { _lifetimeDownload.destroy(); } preparePreview(computed.image->original()); diff --git a/changelog.txt b/changelog.txt index f00562e07d..4d6fe3fe85 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,6 @@ 2.8.9 (16.07.21) +- Fix GIF caption edit. - Fix version on Windows without SetDefaultDllDirectories. - Fix fonts on Linux.