mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
Revert "Removed downscaling of 2560px images before displaying them"
This reverts commit 0f3ec7893d
.
Instead correct max limits of 2560x2560 will be used.
This commit is contained in:
parent
c56977cbc1
commit
7c537cd787
1 changed files with 8 additions and 0 deletions
|
@ -101,6 +101,14 @@ void PhotoMedia::set(
|
|||
QImage image,
|
||||
QByteArray bytes) {
|
||||
const auto index = PhotoSizeIndex(size);
|
||||
const auto limit = PhotoData::SideLimit();
|
||||
if (image.width() > limit || image.height() > limit) {
|
||||
image = image.scaled(
|
||||
limit,
|
||||
limit,
|
||||
Qt::KeepAspectRatio,
|
||||
Qt::SmoothTransformation);
|
||||
}
|
||||
_images[index] = PhotoImage{
|
||||
.data = std::make_unique<Image>(std::move(image)),
|
||||
.bytes = std::move(bytes),
|
||||
|
|
Loading…
Add table
Reference in a new issue