aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/GDI/GDIImageEncoder.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-10-26 18:50:19 -0400
committerLuke <luke.pulverenti@gmail.com>2015-10-26 18:50:19 -0400
commit35778ebc02e5931142a1fe31a256b7488a07c5c2 (patch)
treeced0290be8820f5e507b51ca4c5165212b1879d1 /Emby.Drawing/GDI/GDIImageEncoder.cs
parentc0dc8d055bfd4d2f58591083beb9e9128357aad6 (diff)
parent8d77308593c3b16b733b0109323770d9dfe7e166 (diff)
Merge pull request #1222 from MediaBrowser/dev
3.0.5768.7
Diffstat (limited to 'Emby.Drawing/GDI/GDIImageEncoder.cs')
-rw-r--r--Emby.Drawing/GDI/GDIImageEncoder.cs33
1 files changed, 28 insertions, 5 deletions
diff --git a/Emby.Drawing/GDI/GDIImageEncoder.cs b/Emby.Drawing/GDI/GDIImageEncoder.cs
index 7e3ca530b..530613741 100644
--- a/Emby.Drawing/GDI/GDIImageEncoder.cs
+++ b/Emby.Drawing/GDI/GDIImageEncoder.cs
@@ -1,5 +1,4 @@
-using MediaBrowser.Common.IO;
-using MediaBrowser.Controller.Drawing;
+using MediaBrowser.Controller.Drawing;
using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Logging;
using System;
@@ -8,6 +7,7 @@ using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
+using CommonIO;
using ImageFormat = MediaBrowser.Model.Drawing.ImageFormat;
namespace Emby.Drawing.GDI
@@ -22,7 +22,20 @@ namespace Emby.Drawing.GDI
_fileSystem = fileSystem;
_logger = logger;
- _logger.Info("GDI image processor initialized");
+ LogInfo();
+ }
+
+ private void LogInfo()
+ {
+ _logger.Info("GDIImageEncoder starting");
+ using (var stream = GetType().Assembly.GetManifestResourceStream(GetType().Namespace + ".empty.png"))
+ {
+ using (var img = Image.FromStream(stream))
+ {
+
+ }
+ }
+ _logger.Info("GDIImageEncoder started");
}
public string[] SupportedInputFormats
@@ -66,7 +79,7 @@ namespace Emby.Drawing.GDI
{
using (var croppedImage = image.CropWhitespace())
{
- Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
+ _fileSystem.CreateDirectory(Path.GetDirectoryName(outputPath));
using (var outputStream = _fileSystem.GetFileStream(outputPath, FileMode.Create, FileAccess.Write, FileShare.Read, false))
{
@@ -120,7 +133,7 @@ namespace Emby.Drawing.GDI
var outputFormat = GetOutputFormat(originalImage, selectedOutputFormat);
- Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
+ _fileSystem.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
// Save to the cache location
using (var cacheFileStream = _fileSystem.GetFileStream(cacheFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, false))
@@ -252,5 +265,15 @@ namespace Emby.Drawing.GDI
{
get { return "GDI"; }
}
+
+ public bool SupportsImageCollageCreation
+ {
+ get { return true; }
+ }
+
+ public bool SupportsImageEncoding
+ {
+ get { return true; }
+ }
}
}