mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Remove flags checking for backgrounds.
Also limit image size to 2960px. Fixes #5641.
This commit is contained in:
@@ -1597,11 +1597,13 @@ vst vstm vstx vsw vsx vtx website ws wsc wsf wsh xbap xll xnk");
|
||||
|
||||
base::binary_guard ReadImageAsync(
|
||||
not_null<DocumentData*> document,
|
||||
FnMut<QImage(QImage)> postprocess,
|
||||
FnMut<void(QImage&&)> done) {
|
||||
auto [left, right] = base::make_binary_guard();
|
||||
crl::async([
|
||||
bytes = document->data(),
|
||||
path = document->filepath(),
|
||||
postprocess = std::move(postprocess),
|
||||
guard = std::move(left),
|
||||
callback = std::move(done)
|
||||
]() mutable {
|
||||
@@ -1616,6 +1618,9 @@ base::binary_guard ReadImageAsync(
|
||||
auto image = bytes.isEmpty()
|
||||
? QImage()
|
||||
: App::readImage(bytes, &format, false, nullptr);
|
||||
if (postprocess) {
|
||||
image = postprocess(std::move(image));
|
||||
}
|
||||
crl::on_main([
|
||||
guard = std::move(guard),
|
||||
image = std::move(image),
|
||||
|
Reference in New Issue
Block a user