diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs index c7df48c04..e4c68a8ab 100644 --- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs +++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs @@ -77,5 +77,14 @@ namespace MediaBrowser.Controller.Drawing /// To stream. /// Task. Task ProcessImage(ImageProcessingOptions options, Stream toStream); + + /// + /// Gets the enhanced image. + /// + /// The item. + /// Type of the image. + /// Index of the image. + /// Task{System.String}. + Task GetEnhancedImage(BaseItem item, ImageType imageType, int imageIndex); } } diff --git a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs index c9f9af4f2..6458435ba 100644 --- a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs +++ b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs @@ -539,6 +539,26 @@ namespace MediaBrowser.Server.Implementations.Drawing return string.Join("|", cacheKeys.ToArray()).GetMD5(); } + /// + /// Gets the enhanced image. + /// + /// The item. + /// Type of the image. + /// Index of the image. + /// Task{System.String}. + public async Task GetEnhancedImage(BaseItem item, ImageType imageType, int imageIndex) + { + var enhancers = GetSupportedEnhancers(item, imageType).ToList(); + + var imagePath = item.GetImagePath(imageType, imageIndex); + + var dateModified = item.GetImageDateModified(imagePath); + + var result = await GetEnhancedImage(imagePath, dateModified, item, imageType, imageIndex, enhancers); + + return result.Item1; + } + private async Task> GetEnhancedImage(string originalImagePath, DateTime dateModified, BaseItem item, ImageType imageType, int imageIndex, List enhancers)