float wScale = (float) RESIZED_IMAGE_WIDTH / width;
float hscale = (float) RESIZED_IMAGE_HEIGHT / height;
float scale = Math.min(wScale, hscale);
if (scale < 1) {
image = service.resize(image, "jpg", (int) (width * scale),
(int) (height * scale), info.getDepth());
image.setMimeType("image/jpeg"); // XXX : Should be automatic
doc.setPropertyValue(CONTENT_PICTURE_PICTURE_PROPERTY,
(Serializable) image);
}