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:
John Preston 2023-01-02 12:35:18 +04:00
parent c56977cbc1
commit 7c537cd787

View file

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