This project is read-only.

Orchard.Media.Services.IMediaService does not contain a definition for 'FileAllowed'


This error occurs in ImageFieldDriver with the latest Orchard 1.1 source. Obviously there's being a breaking change to IMediaService at some point. My temporary workaround is just to remove the check.
Can I just make some suggestions from the code I've looked at here and in MediaService;
  • The ImageFieldDriver goes through a whole process of resizing the image (or refusing it) if it's too big, based on settings from the ImageField. Surely MediaService should be responsible for this, and there should be site-wide settings for maximum image size and resize options.
  • It's preferably to store the original, full-sized image; and also create a scaled-down version for page display. That way you can hyperlink the image so the user can download a full sized one if they want.
  • Further to that; MediaService itself really needs to be managing this resizing of images, with a flexible system that will produce different sized versions of an image as required - for instance, for different sized thumbnails on different pages of your site. I've done this in other projects by generating the thumbnail cache files with names like original-file-name-{x}-{y}-{identifier}.jpg. You could even have a service that would take a query string x=&y= ... and serve previously-resized images (the caches should never be generated from the service, only when requested in code_.
  • What is currently happening that I've seen in other image-related projects (there are at least 3 on the Orchard Gallery now) is that each project is implementing its own version of these various processes in slightly different ways, where it would be preferable to have site-wide image management (which of course could be extended or overridden if needed) - and then choose which gallery plugin you use that would simply pull data from this.
    I realise much of this would be in the scope of an Orchard workitem and I will raise this there as well.


randompete wrote Mar 31, 2011 at 8:15 PM

I'm extremely sorry, I posted this on completely the wrong project. I was looking for Please delete this workitem :)

wrote Feb 13, 2013 at 7:11 PM