aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/GDI/GDIImageEncoder.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-08 11:45:30 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-08 11:45:30 -0400
commitb289b4cc7f547a982b9a06e54cd2fbc893e122bd (patch)
tree303d29e0d16736ef6b8fc1d006908920b9759d53 /Emby.Drawing/GDI/GDIImageEncoder.cs
parent4820fe80971c83cde97a445e45b9e0b1952b0d90 (diff)
complete gdi fallback
Diffstat (limited to 'Emby.Drawing/GDI/GDIImageEncoder.cs')
-rw-r--r--Emby.Drawing/GDI/GDIImageEncoder.cs18
1 files changed, 17 insertions, 1 deletions
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()