From 3a5bad4b7acaede35df67a8ada738ab9b52a7837 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 22 Mar 2019 10:27:22 +0300 Subject: [PATCH] Fixed incorrect display of uploaded video's thumbnail in edited message. - After uploading a video the data_document changes a source of the good thumbnail and loses an information about it (e.g. width, height, bytesSize). --- Telegram/SourceFiles/ui/image/image.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Telegram/SourceFiles/ui/image/image.cpp b/Telegram/SourceFiles/ui/image/image.cpp index e6fc79460..4694106e0 100644 --- a/Telegram/SourceFiles/ui/image/image.cpp +++ b/Telegram/SourceFiles/ui/image/image.cpp @@ -334,6 +334,11 @@ Image::Image(std::unique_ptr &&source) } void Image::replaceSource(std::unique_ptr &&source) { + const auto width = _source->width(); + const auto height = _source->height(); + if (width > 0 && height > 0) { + source->setInformation(_source->bytesSize(), width, height); + } _source = std::move(source); }