2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Use final Image with different Images::Source-s.

This commit is contained in:
John Preston
2018-10-12 19:41:51 +03:00
parent 5a50248055
commit 4b5b79e415
16 changed files with 1376 additions and 993 deletions

View File

@@ -660,8 +660,8 @@ bool DocumentData::loaded(FilePathResolveType type) const {
auto that = const_cast<DocumentData*>(this);
that->_location = FileLocation(_loader->fileName());
that->_data = _loader->bytes();
if (that->sticker() && !_loader->imagePixmap().isNull()) {
that->sticker()->img = ImagePtr(_data, _loader->imageFormat(), _loader->imagePixmap());
if (that->sticker() && !_loader->imageData().isNull()) {
that->sticker()->img = ImagePtr(_data, _loader->imageFormat(), _loader->imageData());
}
destroyLoaderDelayed();
}
@@ -954,7 +954,7 @@ ImagePtr DocumentData::makeReplyPreview(Data::FileOrigin origin) {
auto options = Images::Option::Smooth | (isVideoMessage() ? Images::Option::Circled : Images::Option::None) | Images::Option::TransparentBackground;
auto outerSize = st::msgReplyBarSize.height();
auto image = thumb->pixNoCache(origin, thumbSize.width(), thumbSize.height(), options, outerSize, outerSize);
replyPreview = ImagePtr(image, "PNG");
replyPreview = ImagePtr(image.toImage(), "PNG");
} else {
thumb->load(origin);
}