2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Remove flags checking for backgrounds.

Also limit image size to 2960px.

Fixes #5641.
This commit is contained in:
John Preston
2019-02-04 18:53:00 +03:00
parent b43191506a
commit 4d9464ed87
6 changed files with 46 additions and 36 deletions

View File

@@ -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),