ImageResizer on Mono
I just heard from Nathanael, ImageResizer's owner. He said this fix will be included in the 3.1.5 release.
I was busy writing .NET MVC extension methods to mimic Drupal's ImageCache plugin when I happened upon a ready-made solution. ImageResizer is a mature .NET image manipulation library designed to work seamlessly with ASP.NET web applications. In short, it lets you choose image sizes in your MVC views, and if those sizes don't exist, it'll create them.
As is the plight of the Mono developer, though, ImageResizer doesn't "just work" unless you're on Microsoft's platform. Thankfully, I've been in the Mono game for a while and know where to look when stuff blows up. In this case, the fix was a one-liner.
ImageResizer uses a call to UrlAuthorizationModule.CheckUrlAccessForPrincipal to determine if the application's current user has permission to access the image requested to be resized. Mono does not yet implement it.
I decided to simply wrap the call in a try...catch block that catches a NotImplementedException. The user gets permission for the file by default, so this seemed like the easiest and cleanest solution. I thought about doing a Unix check before the call, but that wouldn't stop projects running on Windows machines in the Mono runtime from blowing up.
The code is below. The ImageResizer source is here. The fix has to go in the method CheckRequest_PostAuthorizeRequest of the InterceptModule class. That class lives in the file InterceptModule.cs, which is in the root of the ImageResizer project directory. The call is around line 110 (see the picture for details).