If a scaled-down JPEG output image is requested, we must decompress and recompress the transformed image.

This commit is contained in:
DRC
2011-03-07 08:21:11 +00:00
parent d594af38e1
commit d04c64b75a

View File

@@ -220,7 +220,7 @@ public class TJExample {
if(outSubsamp < 0) outSubsamp = inSubsamp; if(outSubsamp < 0) outSubsamp = inSubsamp;
if(outFormat.equalsIgnoreCase("jpg") && (xform.op != TJ.XFORM_NONE if(outFormat.equalsIgnoreCase("jpg") && (xform.op != TJ.XFORM_NONE
|| xform.options != 0)) { || xform.options != 0) && (scaleNum == 1 && scaleDenom == 1)) {
file = new File(argv[1]); file = new File(argv[1]);
FileOutputStream fos = new FileOutputStream(file); FileOutputStream fos = new FileOutputStream(file);
fos.write(tjd.getJPEGBuf(), 0, tjd.getJPEGSize()); fos.write(tjd.getJPEGBuf(), 0, tjd.getJPEGSize());