int destWidth = Math.max(3, Math.round(sourceWidth / scale));
int destHeight = Math.max(3, Math.round(sourceHeight / scale));
// System.out.println("Dest (w,h): " + destWidth + ", " + destHeight);
ResampleOp resampleOp = new ResampleOp(destWidth, destHeight);
// resampleOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Soft);
BufferedImage resampled = resampleOp.filter(source, null);
BufferedImage result = null;
if (crop) {
int offsetX = Math.abs(maxWidth - destWidth) / 2;