From f8cde10662b840f6a4b6c1c3cf906dec37d5ac2d Mon Sep 17 00:00:00 2001 From: Daniel Gao Date: Fri, 6 Dec 2024 22:16:27 -0500 Subject: [PATCH] Fix missing min frame border * Previously only considered min border if the current border is smaller * Need to consider as long as min size is enabled --- rtengine/ipresize.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/rtengine/ipresize.cc b/rtengine/ipresize.cc index a49bd91c7..f5d310b6a 100644 --- a/rtengine/ipresize.cc +++ b/rtengine/ipresize.cc @@ -442,12 +442,8 @@ Dimensions Framing::computeRelativeImageBBoxInFrame(const Dimensions& imgSize, double minBorderOther = static_cast( side == Side::WIDTH ? framing.minHeight : framing.minWidth); - if (borderOther < minBorderOther) { - maxImageOther = std::floor(frameOther - 2.0 * minBorderOther); - } - if (borderBasis < minBorderBasis) { - maxImageBasis = std::floor(frameBasis - 2.0 * minBorderBasis); - } + maxImageOther = std::floor(frameOther - 2.0 * minBorderOther); + maxImageBasis = std::floor(frameBasis - 2.0 * minBorderBasis); } // Image is too large to satisfy requirements: @@ -524,10 +520,8 @@ Dimensions Framing::computeUniformRelativeImageBBox(const Dimensions& imgSize, double minBorder = static_cast( side == Side::WIDTH ? framing.minWidth : framing.minHeight); - if (border < minBorder) { - maxImageBasis = std::floor(frameBasis - 2.0 * minBorder); - maxImageOther = std::floor(frameOther - 2.0 * minBorder); - } + maxImageBasis = std::floor(frameBasis - 2.0 * minBorder); + maxImageOther = std::floor(frameOther - 2.0 * minBorder); } if (imgOther > maxImageOther) {