diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-19 11:12:28 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-19 11:12:28 -0400 |
| commit | cb839f9f2595e41c8bb655c3b72ad598ee6666ad (patch) | |
| tree | 2c9d48d1327952c4359e341def9686aea0bdbb1c /MediaBrowser.Controller | |
| parent | 8136647a0a22588947544647aa748746d75a31c6 (diff) | |
Added image output format param
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Drawing/IImageProcessor.cs | 17 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs | 46 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaBrowser.Controller.csproj | 1 |
3 files changed, 49 insertions, 15 deletions
diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs index 55c279b0c..c7df48c04 100644 --- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs +++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs @@ -73,22 +73,9 @@ namespace MediaBrowser.Controller.Drawing /// <summary> /// Processes the image. /// </summary> - /// <param name="entity">The entity.</param> - /// <param name="imageType">Type of the image.</param> - /// <param name="imageIndex">Index of the image.</param> - /// <param name="originalImagePath">The original image path.</param> - /// <param name="cropWhitespace">if set to <c>true</c> [crop whitespace].</param> - /// <param name="dateModified">The date modified.</param> + /// <param name="options">The options.</param> /// <param name="toStream">To stream.</param> - /// <param name="width">The width.</param> - /// <param name="height">The height.</param> - /// <param name="maxWidth">Width of the max.</param> - /// <param name="maxHeight">Height of the max.</param> - /// <param name="quality">The quality.</param> - /// <param name="enhancers">The enhancers.</param> /// <returns>Task.</returns> - Task ProcessImage(BaseItem entity, ImageType imageType, int imageIndex, string originalImagePath, bool cropWhitespace, - DateTime dateModified, Stream toStream, int? width, int? height, int? maxWidth, int? maxHeight, - int? quality, List<IImageEnhancer> enhancers); + Task ProcessImage(ImageProcessingOptions options, Stream toStream); } } diff --git a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs new file mode 100644 index 000000000..7a56015ad --- /dev/null +++ b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs @@ -0,0 +1,46 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Drawing +{ + public class ImageProcessingOptions + { + public BaseItem Item { get; set; } + + public ImageType ImageType { get; set; } + + public int ImageIndex { get; set; } + + public string OriginalImagePath { get; set; } + + public DateTime OriginalImageDateModified { get; set; } + + public bool CropWhiteSpace { get; set; } + + public int? Width { get; set; } + + public int? Height { get; set; } + + public int? MaxWidth { get; set; } + + public int? MaxHeight { get; set; } + + public int? Quality { get; set; } + + public List<IImageEnhancer> Enhancers { get; set; } + + public ImageOutputFormat OutputFormat { get; set; } + } + + public enum ImageOutputFormat + { + Original, + Bmp, + Gif, + Jpg, + Png + } +} diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 960f597ac..ad8b49954 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -72,6 +72,7 @@ <Link>Properties\SharedVersion.cs</Link> </Compile> <Compile Include="Drawing\IImageProcessor.cs" /> + <Compile Include="Drawing\ImageProcessingOptions.cs" /> <Compile Include="Dto\IDtoService.cs" /> <Compile Include="Entities\AdultVideo.cs" /> <Compile Include="Entities\Audio\IHasAlbumArtist.cs" /> |
