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 cb90d2b04..02751972a 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 f00562e07..4d6fe3fe8 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.