# HG changeset patch # User robcast # Date 1445278623 -7200 # Node ID 912b5631f2c4641ed856c76cf9d2f2123d75f171 # Parent d98f760277b4bdee0b272a071be7290ae32ec5cc fix new bug with output image not obeying dw and dh. diff -r d98f760277b4 -r 912b5631f2c4 common/src/main/java/digilib/image/ImageJobDescription.java --- a/common/src/main/java/digilib/image/ImageJobDescription.java Mon Oct 19 20:16:20 2015 +0200 +++ b/common/src/main/java/digilib/image/ImageJobDescription.java Mon Oct 19 20:17:03 2015 +0200 @@ -483,13 +483,15 @@ // calculate dw userImgArea = getUserImgArea(); double imgAspect = userImgArea.getWidth() / userImgArea.getHeight(); - paramDW = (int) Math.round(paramDH * imgAspect); + // round up to make sure we don't squeeze dh + paramDW = (int) Math.ceil(paramDH * imgAspect); setValue("dw", paramDW); } else if (paramDH == 0) { // calculate dh - userImgArea = getUserImgArea(); + userImgArea = getUserImgArea(); double imgAspect = userImgArea.getWidth() / userImgArea.getHeight(); - paramDH = (int) Math.round(paramDW / imgAspect); + // round up to make sure we don't squeeze dw + paramDH = (int) Math.ceil(paramDW / imgAspect); setValue("dh", paramDH); } }