Avoid returning an empty image when target encoding is not supported or

when an error occured while encoding.
pull/26/head
luc 9 years ago
parent fc3294382e
commit e90e1f165d

@ -242,11 +242,16 @@ public class ViewImage {
iconcache.put(urlString, image);
}
}
/* An error can still occur when transcoding from buffered image to target ext : in that case return null */
encodedImage = new EncodedImage(image, ext, isStatic);
if(encodedImage.getImage().length() == 0) {
encodedImage = null;
}
}
return encodedImage;
}
/**
* Calculate image dimensions from image original dimensions, max
* dimensions, and target dimensions.

Loading…
Cancel
Save