mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
Added ability to send webp as compressed image.
This commit is contained in:
@@ -915,7 +915,8 @@ void FileLoadTask::process(Args &&args) {
|
||||
attributes.push_back(MTP_documentAttributeImageSize(MTP_int(w), MTP_int(h)));
|
||||
|
||||
if (ValidateThumbDimensions(w, h)) {
|
||||
isSticker = Core::IsMimeSticker(filemime)
|
||||
isSticker = (_type == SendMediaType::File)
|
||||
&& Core::IsMimeSticker(filemime)
|
||||
&& (filesize < Storage::kMaxStickerBytesSize)
|
||||
&& (Core::IsMimeStickerAnimated(filemime)
|
||||
|| GoodStickerDimensions(w, h));
|
||||
@@ -936,6 +937,9 @@ void FileLoadTask::process(Args &&args) {
|
||||
attributes.push_back(MTP_documentAttributeAnimated());
|
||||
} else if (filemime.startsWith(u"image/"_q)
|
||||
&& _type != SendMediaType::File) {
|
||||
if (Core::IsMimeSticker(filemime)) {
|
||||
fullimage = Images::Opaque(std::move(fullimage));
|
||||
}
|
||||
auto medium = (w > 320 || h > 320) ? fullimage.scaled(320, 320, Qt::KeepAspectRatio, Qt::SmoothTransformation) : fullimage;
|
||||
|
||||
const auto downscaled = (w > 1280 || h > 1280);
|
||||
|
Reference in New Issue
Block a user