From aba6cc2c6494e59a4d6628bd9ece579da42576c4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 12 Nov 2018 13:16:54 +0400 Subject: [PATCH] Don't force WEBP format for stickers. Fixes #5374. --- Telegram/SourceFiles/data/data_document.cpp | 7 ++----- Telegram/SourceFiles/ui/image/image_source.h | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/data/data_document.cpp b/Telegram/SourceFiles/data/data_document.cpp index 7c2a89bf1..06b1da9e6 100644 --- a/Telegram/SourceFiles/data/data_document.cpp +++ b/Telegram/SourceFiles/data/data_document.cpp @@ -1069,14 +1069,11 @@ void DocumentData::checkSticker() { const auto &loc = location(true); if (loc.accessEnable()) { data->image = std::make_unique( - std::make_unique( - loc.name(), - QByteArray(), - "WEBP")); + std::make_unique(loc.name())); loc.accessDisable(); } } else { - auto format = QByteArray("WEBP"); + auto format = QByteArray(); auto image = App::readImage(_data, &format, false); data->image = std::make_unique( std::make_unique( diff --git a/Telegram/SourceFiles/ui/image/image_source.h b/Telegram/SourceFiles/ui/image/image_source.h index 94f92ff6c..932ab80b3 100644 --- a/Telegram/SourceFiles/ui/image/image_source.h +++ b/Telegram/SourceFiles/ui/image/image_source.h @@ -64,10 +64,10 @@ private: class LocalFileSource : public Source { public: - LocalFileSource( + explicit LocalFileSource( const QString &path, - const QByteArray &content, - const QByteArray &format, + const QByteArray &content = QByteArray(), + const QByteArray &format = QByteArray(), QImage &&data = QImage()); void load(