diff --git a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Providers/Filters/ResizeFilter.cs b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Providers/Filters/ResizeFilter.cs index eabe1e3cc..25f76db2f 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Providers/Filters/ResizeFilter.cs +++ b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Providers/Filters/ResizeFilter.cs @@ -8,7 +8,6 @@ using Orchard.Forms.Services; using Orchard.Localization; using Orchard.MediaProcessing.Descriptors.Filter; using Orchard.MediaProcessing.Services; -using Orchard.Utility.Extensions; namespace Orchard.MediaProcessing.Providers.Filters { public class ResizeFilter : IImageFilterProvider { @@ -72,7 +71,7 @@ namespace Orchard.MediaProcessing.Providers.Filters { if (context.Media.CanSeek) { context.Media.Seek(0, SeekOrigin.Begin); } - ImageBuilder.Current.Build(context.Media, result, settings); + ImageBuilder.Current.Build(context.Media, result, settings, true); context.Media = result; } diff --git a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs index a63581b55..a187c81df 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs +++ b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs @@ -110,6 +110,10 @@ namespace Orchard.MediaProcessing.Services { var filterContext = new FilterContext { Media = image, FilePath = _storageProvider.Combine("_Profiles", _storageProvider.Combine(profileName, CreateDefaultFileName(path))) }; + if (image == null) { + return filterContext.FilePath; + } + var tokens = new Dictionary(); // if a content item is provided, use it while tokenizing if (contentItem != null) { @@ -160,14 +164,18 @@ namespace Orchard.MediaProcessing.Services { // TODO: Update this method once the storage provider has been updated private Stream GetImage(string path) { + if (path == null) { + throw new ArgumentNullException("path"); + } + var storagePath = _storageProvider.GetStoragePath(path); if (storagePath != null) { try { var file = _storageProvider.GetFile(storagePath); return file.OpenRead(); } - catch { - Logger.Error("path:" + path + " storagePath:" + storagePath); + catch(Exception e) { + Logger.Error(e, "path:" + path + " storagePath:" + storagePath); } }