# HG changeset patch # User robcast # Date 1445346679 -7200 # Node ID 5f3265ea088c05fab4c0e9f9c4766f7237b71650 # Parent 07914dfe7a4c0a50be6254d99c6c096e3e4c1921 working on black-last-pixel bug... diff -r 07914dfe7a4c -r 5f3265ea088c common/src/main/java/digilib/image/ImageJobDescription.java --- a/common/src/main/java/digilib/image/ImageJobDescription.java Mon Oct 19 20:21:10 2015 +0200 +++ b/common/src/main/java/digilib/image/ImageJobDescription.java Tue Oct 20 15:11:19 2015 +0200 @@ -480,14 +480,14 @@ paramDH = getAsInt("dh"); if (paramDW == 0) { - // calculate dw + // calculate dw using aspect ratio of image area userImgArea = getUserImgArea(); double imgAspect = userImgArea.getWidth() / userImgArea.getHeight(); // 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 + // calculate dh using aspect ratio of image area userImgArea = getUserImgArea(); double imgAspect = userImgArea.getWidth() / userImgArea.getHeight(); // round up to make sure we don't squeeze dw @@ -513,15 +513,17 @@ paramDH = getAsInt("dh"); if (paramDW == 0) { - // calculate dw + // calculate dw using aspect ratio of image area userImgArea = getUserImgArea(); double imgAspect = userImgArea.getWidth() / userImgArea.getHeight(); + // 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 + // calculate dh using aspect ratio of image area userImgArea = getUserImgArea(); double imgAspect = userImgArea.getWidth() / userImgArea.getHeight(); + // round up to make sure we don't squeeze dh paramDH = (int) Math.ceil(paramDW / imgAspect); setValue("dh", paramDH); } diff -r 07914dfe7a4c -r 5f3265ea088c common/src/main/java/digilib/image/ImageLoaderDocuImage.java --- a/common/src/main/java/digilib/image/ImageLoaderDocuImage.java Mon Oct 19 20:21:10 2015 +0200 +++ b/common/src/main/java/digilib/image/ImageLoaderDocuImage.java Tue Oct 20 15:11:19 2015 +0200 @@ -448,6 +448,7 @@ public void scale(double scaleX, double scaleY) throws ImageOpException { logger.debug("scale: " + scaleX); + logger.debug("scaled from " + img.getWidth() + "x" + img.getHeight() + " img=" + img); /* for downscaling in high quality the image is blurred first */ if ((scaleX <= 0.5) && (quality > 1)) { int bl = (int) Math.floor(1 / scaleX);