Load photo thumbnail only if no inline thumbnail found.

This commit is contained in:
John Preston 2021-02-22 14:35:21 +04:00
parent 3d85ca2f84
commit aa46ec8bc1
1 changed files with 4 additions and 3 deletions

View File

@ -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);