From b289b4cc7f547a982b9a06e54cd2fbc893e122bd Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 8 Apr 2015 11:45:30 -0400 Subject: complete gdi fallback --- Emby.Drawing/GDI/GDIImageEncoder.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'Emby.Drawing/GDI/GDIImageEncoder.cs') diff --git a/Emby.Drawing/GDI/GDIImageEncoder.cs b/Emby.Drawing/GDI/GDIImageEncoder.cs index c6537fc43..33502c5e1 100644 --- a/Emby.Drawing/GDI/GDIImageEncoder.cs +++ b/Emby.Drawing/GDI/GDIImageEncoder.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.IO; +using System.Linq; +using MediaBrowser.Common.IO; using MediaBrowser.Controller.Drawing; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Logging; @@ -224,6 +225,21 @@ namespace Emby.Drawing.GDI public void CreateImageCollage(ImageCollageOptions options) { + double ratio = options.Width; + ratio /= options.Height; + + if (ratio >= 1.4) + { + DynamicImageHelpers.CreateThumbCollage(options.InputPaths.ToList(), _fileSystem, options.OutputPath, options.Width, options.Height); + } + else if (ratio >= .9) + { + DynamicImageHelpers.CreateSquareCollage(options.InputPaths.ToList(), _fileSystem, options.OutputPath, options.Width, options.Height); + } + else + { + DynamicImageHelpers.CreateSquareCollage(options.InputPaths.ToList(), _fileSystem, options.OutputPath, options.Width, options.Width); + } } public void Dispose() -- cgit v1.2.3