2014-05-06 31 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

相關問題