From aa46ec8bc14afe1726d8cc4d500c47349315c81c Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 22 Feb 2021 14:35:21 +0400 Subject: [PATCH] Load photo thumbnail only if no inline thumbnail found. --- .../SourceFiles/history/view/media/history_view_photo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp index b86d4fdef..e72f121d6 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp @@ -109,7 +109,8 @@ void Photo::ensureDataMediaCreated() const { void Photo::dataMediaCreated() const { Expects(_dataMedia != nullptr); - if (!_dataMedia->image(PhotoSize::Large) + if (_data->inlineThumbnailBytes().isEmpty() + && !_dataMedia->image(PhotoSize::Large) && !_dataMedia->image(PhotoSize::Thumbnail)) { _dataMedia->wanted(PhotoSize::Small, _realParent->fullId()); } @@ -376,10 +377,10 @@ void Photo::paintUserpicFrame( if (const auto large = _dataMedia->image(PhotoSize::Large)) { return large->pixCircled(_pixw, _pixh); } else if (const auto thumbnail = _dataMedia->image( - PhotoSize::Thumbnail)) { + PhotoSize::Thumbnail)) { return thumbnail->pixBlurredCircled(_pixw, _pixh); } else if (const auto small = _dataMedia->image( - PhotoSize::Small)) { + PhotoSize::Small)) { return small->pixBlurredCircled(_pixw, _pixh); } else if (const auto blurred = _dataMedia->thumbnailInline()) { return blurred->pixBlurredCircled(_pixw, _pixh);