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).
This commit is contained in:
23rd 2019-03-22 10:27:22 +03:00 committed by John Preston
parent 2aecd1035e
commit 3a5bad4b7a
1 changed files with 5 additions and 0 deletions

View File

@ -334,6 +334,11 @@ Image::Image(std::unique_ptr<Source> &&source)
}
void Image::replaceSource(std::unique_ptr<Source> &&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);
}