From d04c64b75a8f0628faba4d72a87edfbe68d9339d Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 7 Mar 2011 08:21:11 +0000 Subject: [PATCH] If a scaled-down JPEG output image is requested, we must decompress and recompress the transformed image. --- java/TJExample.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/TJExample.java b/java/TJExample.java index 7f4d3d5f..768be981 100644 --- a/java/TJExample.java +++ b/java/TJExample.java @@ -220,7 +220,7 @@ public class TJExample { if(outSubsamp < 0) outSubsamp = inSubsamp; if(outFormat.equalsIgnoreCase("jpg") && (xform.op != TJ.XFORM_NONE - || xform.options != 0)) { + || xform.options != 0) && (scaleNum == 1 && scaleDenom == 1)) { file = new File(argv[1]); FileOutputStream fos = new FileOutputStream(file); fos.write(tjd.getJPEGBuf(), 0, tjd.getJPEGSize());