String contentType = resp.getHeader("Content-Type");
if (contentType == null || contentType.toLowerCase().startsWith("image/")) {
// Unspecified or unknown image mime type.
try {
ImageFormat imageFormat = Sanselan
.guessFormat(new ByteSourceInputStream(resp.getContentBytes(),
request.getUri().getPath()));
if (imageFormat == ImageFormat.IMAGE_FORMAT_UNKNOWN) {
if (LOG.isLoggable(Level.INFO)) {
LOG.logp(Level.INFO, classname, "rewriteProxiedImage", MessageKeys.UNABLE_SANITIZE_UNKNOWN_IMG,new Object[] {request.getUri().toString()});
}