mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 15:35:51 +00:00
Implement lossless jpeg progression
This commit is contained in:
@@ -183,10 +183,16 @@ struct PreparedFileThumbnail {
|
|||||||
if (!bytes.isEmpty()
|
if (!bytes.isEmpty()
|
||||||
&& (bytes.size()
|
&& (bytes.size()
|
||||||
<= full.width() * full.height() * kRecompressAfterBpp / 8)
|
<= full.width() * full.height() * kRecompressAfterBpp / 8)
|
||||||
&& (format == u"jpeg"_q)
|
&& (format == u"jpeg"_q)) {
|
||||||
&& Images::IsProgressiveJpeg(bytes)) {
|
if (!Images::IsProgressiveJpeg(bytes)) {
|
||||||
|
if (const auto result = Images::MakeProgressiveJpeg(bytes)
|
||||||
|
; !result.isEmpty()) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto result = QByteArray();
|
auto result = QByteArray();
|
||||||
QBuffer buffer(&result);
|
QBuffer buffer(&result);
|
||||||
|
Submodule Telegram/lib_ui updated: 3cb645f507...6cd13e1057
Reference in New Issue
Block a user