2
Vote

Use Orchard Media Library and Media Processing

description

I've made some changes to the image gallery module that I think might be worth considering putting back into the product.
  1. When adding an image, I changed the ImageGalleryService to call IMediaLibraryService.ImportMedia rather than UploadMediaFile. This way a MediaPart is correctly generated and the image can be viewed in the Media Library.
  2. I refactored the ThumbnailService to take advantage of the Resize Transform that is now built-in to the Media Processing module. This eliminates the need to generate and store separate thumbnail images in the media library. As part of this, the logic to delete thumbnails is no longer required when deleting an image from the gallery.
I've attached a patch file with the changes.

Please note. I generated the patch from my GIT repo, so if you are importing it into your SVN environment I think you'll need to do something like: patch -p1 -i thepatchfile.patch

file attachments

comments