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,10 +242,15 @@ public class ViewImage {
iconcache.put(urlString, image); 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); encodedImage = new EncodedImage(image, ext, isStatic);
if(encodedImage.getImage().length() == 0) {
encodedImage = null;
}
} }
return encodedImage; return encodedImage;
} }
/** /**
* Calculate image dimensions from image original dimensions, max * Calculate image dimensions from image original dimensions, max

Loading…
Cancel
Save