From b65fb3a14e98524ffa1643d9cd99b2941f0ea5c0 Mon Sep 17 00:00:00 2001 From: requizm Date: Thu, 27 Jun 2024 23:23:20 +0300 Subject: [PATCH] Fixed size calculation on resize_image --- src/app/util/resize_image.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/util/resize_image.cpp b/src/app/util/resize_image.cpp index b207c8b76..87c885140 100644 --- a/src/app/util/resize_image.cpp +++ b/src/app/util/resize_image.cpp @@ -21,6 +21,7 @@ #include "doc/sprite.h" #include +#include #include namespace app { @@ -33,8 +34,8 @@ doc::Image* resize_image( const RgbMap* rgbmap) { doc::ImageSpec spec = image->spec(); - spec.setWidth(std::max(1, int(scale.w*image->width()))); - spec.setHeight(std::max(1, int(scale.h*image->height()))); + spec.setWidth(std::max(1, int(std::round(scale.w*image->width())))); + spec.setHeight(std::max(1, int(std::round(scale.h*image->height())))); std::unique_ptr newImage( doc::Image::create(spec)); newImage->setMaskColor(image->maskColor());