Don't force WEBP format for stickers.

Fixes #5374.
This commit is contained in:
John Preston 2018-11-12 13:16:54 +04:00
parent 0718520f36
commit aba6cc2c64
2 changed files with 5 additions and 8 deletions

View File

@ -1069,14 +1069,11 @@ void DocumentData::checkSticker() {
const auto &loc = location(true); const auto &loc = location(true);
if (loc.accessEnable()) { if (loc.accessEnable()) {
data->image = std::make_unique<Image>( data->image = std::make_unique<Image>(
std::make_unique<Images::LocalFileSource>( std::make_unique<Images::LocalFileSource>(loc.name()));
loc.name(),
QByteArray(),
"WEBP"));
loc.accessDisable(); loc.accessDisable();
} }
} else { } else {
auto format = QByteArray("WEBP"); auto format = QByteArray();
auto image = App::readImage(_data, &format, false); auto image = App::readImage(_data, &format, false);
data->image = std::make_unique<Image>( data->image = std::make_unique<Image>(
std::make_unique<Images::LocalFileSource>( std::make_unique<Images::LocalFileSource>(

View File

@ -64,10 +64,10 @@ private:
class LocalFileSource : public Source { class LocalFileSource : public Source {
public: public:
LocalFileSource( explicit LocalFileSource(
const QString &path, const QString &path,
const QByteArray &content, const QByteArray &content = QByteArray(),
const QByteArray &format, const QByteArray &format = QByteArray(),
QImage &&data = QImage()); QImage &&data = QImage());
void load( void load(