2014-05-06 30 views
-1

查看我的日志找到这个异常,但无法弄清楚它应该如何修复,有什么想法?需要处理图像调整大小的异常

ImageResizer.ImageProcessingException (0x80004005): Image Resizer: No image encoder was found for the request. 
    в ImageResizer.InterceptModule.HandleRequest(HttpContext context, String virtualPath, NameValueCollection queryString, IVirtualFile vf) 
    в ImageResizer.InterceptModule.CheckRequest_PostAuthorizeRequest(Object sender, EventArgs e) 
    в System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    в System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

如果在配置中有这样的地方,我可以侦听异常并正确处理它们。它作为HttpModule安装,可以计算如何处理全局异常。

回答

0

ImageResizer根据&format=查询字符串值选择编码器。

此错误最常见的原因是错字,请求image.jpg?format=jif而不是image.jpg?format=gif

+0

谢谢,但实际上我从来没有使用这样的查询字符串(&格式=)。在ImageResizer的配置中还是在Event的子节点中侦听异常并正确处理它们。 – Alexandr

+0

这并不意味着你的访问者或机器人没有。 ImageResizer抛出ImageProcessingExceptions,因此您可以识别它们 - 您如何处理未处理的应用程序异常取决于您。 –

+0

它实际上是开发人员内部的nonindex网站,它被市场营销人员使用。我不认为人们可以明确地做到这一点。您能否提供一些代码示例,我如何在ImageResizer中捕获这些代码?我真的很感激这一点。 – Alexandr

相关问题