Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Avoid returning an empty image when target encoding is not supported or when an error occured while encoding.

luce90e1f165d72
diff --git a/htroot/ViewImage.java b/htroot/ViewImage.java
index 695b5c82a..cbfa772f7 100644
--- a/htroot/ViewImage.java
+++ b/htroot/ViewImage.java
@@ -242,10 +242,15 @@ 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