From 5fe7719467c0a34baca58fb7bf090b64ed5c7dd8 Mon Sep 17 00:00:00 2001 From: Hombre Date: Tue, 14 Dec 2010 21:27:50 +0100 Subject: [PATCH] Fixing issue #407 (Wrong crop rectangle saved) --- rtgui/crop.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rtgui/crop.cc b/rtgui/crop.cc index a727c9bd1..4005b73e0 100644 --- a/rtgui/crop.cc +++ b/rtgui/crop.cc @@ -351,7 +351,13 @@ void Crop::trim (ProcParams* pp, int ow, int oh) { int xmin = pp->crop.x; int ymin = pp->crop.y; - if (xmin > maxw || ymin > maxh) { + + if (pp->coarse.rotate == 90 || pp->coarse.rotate == 270) { + int tmp = oh; + oh = ow; + ow = tmp; + } + if (xmin > ow || ymin > oh) { // the crop is completely out of the image, so we disable the crop pp->crop.enabled = false; // and we set the values to the defaults