diff options
Diffstat (limited to 'Emby.Drawing.ImageMagick')
| -rw-r--r-- | Emby.Drawing.ImageMagick/Emby.Drawing.ImageMagick.csproj | 9 | ||||
| -rw-r--r-- | Emby.Drawing.ImageMagick/ImageHelpers.cs | 6 | ||||
| -rw-r--r-- | Emby.Drawing.ImageMagick/ImageMagickEncoder.cs | 13 | ||||
| -rw-r--r-- | Emby.Drawing.ImageMagick/StripCollageBuilder.cs | 12 | ||||
| -rw-r--r-- | Emby.Drawing.ImageMagick/packages.config | 2 |
5 files changed, 21 insertions, 21 deletions
diff --git a/Emby.Drawing.ImageMagick/Emby.Drawing.ImageMagick.csproj b/Emby.Drawing.ImageMagick/Emby.Drawing.ImageMagick.csproj index 98e99c92b..c4cef629a 100644 --- a/Emby.Drawing.ImageMagick/Emby.Drawing.ImageMagick.csproj +++ b/Emby.Drawing.ImageMagick/Emby.Drawing.ImageMagick.csproj @@ -31,8 +31,7 @@ </PropertyGroup> <ItemGroup> <Reference Include="ImageMagickSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\ImageMagickSharp.1.0.0.18\lib\net45\ImageMagickSharp.dll</HintPath> - <Private>True</Private> + <HintPath>..\packages\ImageMagickSharp.1.0.0.19\lib\net45\ImageMagickSharp.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> @@ -56,9 +55,6 @@ <EmbeddedResource Include="fonts\robotoregular.ttf" /> </ItemGroup> <ItemGroup> - <None Include="packages.config" /> - </ItemGroup> - <ItemGroup> <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj"> <Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project> <Name>MediaBrowser.Common</Name> @@ -72,6 +68,9 @@ <Name>MediaBrowser.Model</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/Emby.Drawing.ImageMagick/ImageHelpers.cs b/Emby.Drawing.ImageMagick/ImageHelpers.cs index c623c21aa..866693399 100644 --- a/Emby.Drawing.ImageMagick/ImageHelpers.cs +++ b/Emby.Drawing.ImageMagick/ImageHelpers.cs @@ -6,13 +6,13 @@ namespace Emby.Drawing.ImageMagick { internal static class ImageHelpers { - internal static List<string> ProjectPaths(List<string> paths, int count) + internal static List<string> ProjectPaths(string[] paths, int count) { if (count <= 0) { throw new ArgumentOutOfRangeException("count"); } - if (paths.Count == 0) + if (paths.Length == 0) { throw new ArgumentOutOfRangeException("paths"); } @@ -24,7 +24,7 @@ namespace Emby.Drawing.ImageMagick return list.Take(count).ToList(); } - private static void AddToList(List<string> list, List<string> paths, int count) + private static void AddToList(List<string> list, string[] paths, int count) { while (list.Count < count) { diff --git a/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs b/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs index ea8687de0..2c40bf570 100644 --- a/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs +++ b/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs @@ -7,13 +7,12 @@ using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Logging; using System; using System.IO; -using System.Linq; using MediaBrowser.Model.IO; using MediaBrowser.Model.System; namespace Emby.Drawing.ImageMagick { - public class ImageMagickEncoder : IImageEncoder + public class ImageMagickEncoder : IImageEncoder, IDisposable { private readonly ILogger _logger; private readonly IApplicationPaths _appPaths; @@ -39,7 +38,8 @@ namespace Emby.Drawing.ImageMagick // Some common file name extensions for RAW picture files include: .cr2, .crw, .dng, .nef, .orf, .rw2, .pef, .arw, .sr2, .srf, and .tif. return new[] { - "tiff", + "tiff", + "tif", "jpeg", "jpg", "png", @@ -306,15 +306,15 @@ namespace Emby.Drawing.ImageMagick if (ratio >= 1.4) { - new StripCollageBuilder(_appPaths, _fileSystem).BuildThumbCollage(options.InputPaths.ToList(), options.OutputPath, options.Width, options.Height); + new StripCollageBuilder(_appPaths, _fileSystem).BuildThumbCollage(options.InputPaths, options.OutputPath, options.Width, options.Height); } else if (ratio >= .9) { - new StripCollageBuilder(_appPaths, _fileSystem).BuildSquareCollage(options.InputPaths.ToList(), options.OutputPath, options.Width, options.Height); + new StripCollageBuilder(_appPaths, _fileSystem).BuildSquareCollage(options.InputPaths, options.OutputPath, options.Width, options.Height); } else { - new StripCollageBuilder(_appPaths, _fileSystem).BuildPosterCollage(options.InputPaths.ToList(), options.OutputPath, options.Width, options.Height); + new StripCollageBuilder(_appPaths, _fileSystem).BuildPosterCollage(options.InputPaths, options.OutputPath, options.Width, options.Height); } } @@ -328,6 +328,7 @@ namespace Emby.Drawing.ImageMagick { _disposed = true; Wand.CloseEnvironment(); + GC.SuppressFinalize(this); } private void CheckDisposed() diff --git a/Emby.Drawing.ImageMagick/StripCollageBuilder.cs b/Emby.Drawing.ImageMagick/StripCollageBuilder.cs index 63cf8fe5f..26c6c868d 100644 --- a/Emby.Drawing.ImageMagick/StripCollageBuilder.cs +++ b/Emby.Drawing.ImageMagick/StripCollageBuilder.cs @@ -19,7 +19,7 @@ namespace Emby.Drawing.ImageMagick _fileSystem = fileSystem; } - public void BuildPosterCollage(List<string> paths, string outputPath, int width, int height) + public void BuildPosterCollage(string[] paths, string outputPath, int width, int height) { using (var wand = BuildPosterCollageWand(paths, width, height)) { @@ -27,7 +27,7 @@ namespace Emby.Drawing.ImageMagick } } - public void BuildSquareCollage(List<string> paths, string outputPath, int width, int height) + public void BuildSquareCollage(string[] paths, string outputPath, int width, int height) { using (var wand = BuildSquareCollageWand(paths, width, height)) { @@ -35,7 +35,7 @@ namespace Emby.Drawing.ImageMagick } } - public void BuildThumbCollage(List<string> paths, string outputPath, int width, int height) + public void BuildThumbCollage(string[] paths, string outputPath, int width, int height) { using (var wand = BuildThumbCollageWand(paths, width, height)) { @@ -43,7 +43,7 @@ namespace Emby.Drawing.ImageMagick } } - private MagickWand BuildPosterCollageWand(List<string> paths, int width, int height) + private MagickWand BuildPosterCollageWand(string[] paths, int width, int height) { var inputPaths = ImageHelpers.ProjectPaths(paths, 3); using (var wandImages = new MagickWand(inputPaths.ToArray())) @@ -108,7 +108,7 @@ namespace Emby.Drawing.ImageMagick } } - private MagickWand BuildThumbCollageWand(List<string> paths, int width, int height) + private MagickWand BuildThumbCollageWand(string[] paths, int width, int height) { var inputPaths = ImageHelpers.ProjectPaths(paths, 4); using (var wandImages = new MagickWand(inputPaths.ToArray())) @@ -173,7 +173,7 @@ namespace Emby.Drawing.ImageMagick } } - private MagickWand BuildSquareCollageWand(List<string> paths, int width, int height) + private MagickWand BuildSquareCollageWand(string[] paths, int width, int height) { var inputPaths = ImageHelpers.ProjectPaths(paths, 4); var outputWand = new MagickWand(width, height, new PixelWand("none", 1)); diff --git a/Emby.Drawing.ImageMagick/packages.config b/Emby.Drawing.ImageMagick/packages.config index 619310d28..aaf7ab7ba 100644 --- a/Emby.Drawing.ImageMagick/packages.config +++ b/Emby.Drawing.ImageMagick/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="ImageMagickSharp" version="1.0.0.18" targetFramework="net452" /> + <package id="ImageMagickSharp" version="1.0.0.19" targetFramework="net452" /> </packages>
\ No newline at end of file |
