(Messages.formatMessage("jpeg.unspecifiedQuality", null));
handler.error(te);
quality = .75f;
}
JPEGImageEncoder jpegEncoder;
JPEGEncodeParam params;
jpegEncoder = JPEGCodec.createJPEGEncoder(ostream);
params = JPEGCodec.getDefaultJPEGEncodeParam(img);
params.setQuality(quality, true);
float PixSzMM = userAgent.getPixelUnitToMillimeter();
int PixSzInch = (int)(25.4/PixSzMM+0.5);
params.setDensityUnit(JPEGEncodeParam.DENSITY_UNIT_DOTS_INCH);
params.setXDensity(PixSzInch);
params.setYDensity(PixSzInch);
jpegEncoder.encode(img, params);
ostream.flush();
} catch (IOException ex) {
throw new TranscoderException(ex);
}
}