diff --git a/Telegram/SourceFiles/history/media/history_media_gif.cpp b/Telegram/SourceFiles/history/media/history_media_gif.cpp index 1cf1383c1..3515e1ce1 100644 --- a/Telegram/SourceFiles/history/media/history_media_gif.cpp +++ b/Telegram/SourceFiles/history/media/history_media_gif.cpp @@ -349,7 +349,7 @@ void HistoryGif::draw(Painter &p, const QRect &r, TextSelection selection, TimeM } if (const auto normal = _data->thumbnail()) { if (normal->loaded()) { - p.drawPixmap(rthumb.topLeft(), _data->thumbnail()->pixSingle(_realParent->fullId(), _thumbw, _thumbh, usew, painth, roundRadius, roundCorners)); + p.drawPixmap(rthumb.topLeft(), normal->pixSingle(_realParent->fullId(), _thumbw, _thumbh, usew, painth, roundRadius, roundCorners)); } else if (const auto blurred = _data->thumbnailInline()) { p.drawPixmap(rthumb.topLeft(), blurred->pixBlurredSingle(_realParent->fullId(), _thumbw, _thumbh, usew, painth, roundRadius, roundCorners)); } diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 299399bbc..f6f387df1 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -1798,10 +1798,14 @@ void MediaView::initAnimation() { } else if (_doc->dimensions.width() && _doc->dimensions.height()) { auto w = _doc->dimensions.width(); auto h = _doc->dimensions.height(); - _current = _doc->thumbnail()->pixNoCache(fileOrigin(), w, h, VideoThumbOptions(_doc), w / cIntRetinaFactor(), h / cIntRetinaFactor()); + _current = (_doc->hasThumbnail() + ? _doc->thumbnail() + : Image::Blank().get())->pixNoCache(fileOrigin(), w, h, VideoThumbOptions(_doc), w / cIntRetinaFactor(), h / cIntRetinaFactor()); _current.setDevicePixelRatio(cRetinaFactor()); } else { - _current = _doc->thumbnail()->pixNoCache(fileOrigin(), _doc->thumbnail()->width(), _doc->thumbnail()->height(), VideoThumbOptions(_doc), st::mediaviewFileIconSize, st::mediaviewFileIconSize); + _current = (_doc->hasThumbnail() + ? _doc->thumbnail() + : Image::Blank().get())->pixNoCache(fileOrigin(), _doc->thumbnail()->width(), _doc->thumbnail()->height(), VideoThumbOptions(_doc), st::mediaviewFileIconSize, st::mediaviewFileIconSize); } } @@ -1814,10 +1818,14 @@ void MediaView::createClipReader() { if (_doc->dimensions.width() && _doc->dimensions.height()) { int w = _doc->dimensions.width(); int h = _doc->dimensions.height(); - _current = _doc->thumbnail()->pixNoCache(fileOrigin(), w, h, VideoThumbOptions(_doc), w / cIntRetinaFactor(), h / cIntRetinaFactor()); + _current = (_doc->hasThumbnail() + ? _doc->thumbnail() + : Image::Blank().get())->pixNoCache(fileOrigin(), w, h, VideoThumbOptions(_doc), w / cIntRetinaFactor(), h / cIntRetinaFactor()); _current.setDevicePixelRatio(cRetinaFactor()); } else { - _current = _doc->thumbnail()->pixNoCache(fileOrigin(), _doc->thumbnail()->width(), _doc->thumbnail()->height(), VideoThumbOptions(_doc), st::mediaviewFileIconSize, st::mediaviewFileIconSize); + _current = (_doc->hasThumbnail() + ? _doc->thumbnail() + : Image::Blank().get())->pixNoCache(fileOrigin(), _doc->thumbnail()->width(), _doc->thumbnail()->height(), VideoThumbOptions(_doc), st::mediaviewFileIconSize, st::mediaviewFileIconSize); } auto mode = (_doc->isVideoFile() || _doc->isVideoMessage()) ? Media::Clip::Reader::Mode::Video