From d7d5294ab5ec53429a906792ef8e7041cbdcd429 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 21 Apr 2017 18:51:33 -0400 Subject: rework image libs --- .../MediaBrowser.Server.Mono.csproj | 1 + .../ImageEncoderHelper.cs | 48 ---------------------- .../MediaBrowser.Server.Startup.Common.csproj | 13 ------ .../ImageEncoderHelper.cs | 48 ++++++++++++++++++++++ .../MediaBrowser.ServerApplication.csproj | 1 + 5 files changed, 50 insertions(+), 61 deletions(-) delete mode 100644 MediaBrowser.Server.Startup.Common/ImageEncoderHelper.cs create mode 100644 MediaBrowser.ServerApplication/ImageEncoderHelper.cs diff --git a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj index 17d9767f6b..bcdfa858ff 100644 --- a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj +++ b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj @@ -117,6 +117,7 @@ Properties\SharedVersion.cs + diff --git a/MediaBrowser.Server.Startup.Common/ImageEncoderHelper.cs b/MediaBrowser.Server.Startup.Common/ImageEncoderHelper.cs deleted file mode 100644 index ddbde2f666..0000000000 --- a/MediaBrowser.Server.Startup.Common/ImageEncoderHelper.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using Emby.Drawing; -using Emby.Drawing.Net; -using Emby.Drawing.ImageMagick; -using Emby.Server.Core; -using Emby.Server.Implementations; -using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Drawing; -using MediaBrowser.Model.IO; -using MediaBrowser.Model.Logging; - -namespace MediaBrowser.Server.Startup.Common -{ - public class ImageEncoderHelper - { - public static IImageEncoder GetImageEncoder(ILogger logger, - ILogManager logManager, - IFileSystem fileSystem, - StartupOptions startupOptions, - Func httpClient, - IApplicationPaths appPaths) - { - if (!startupOptions.ContainsOption("-enablegdi")) - { - try - { - return new ImageMagickEncoder(logManager.GetLogger("ImageMagick"), appPaths, httpClient, fileSystem); - } - catch - { - logger.Error("Error loading ImageMagick. Will revert to GDI."); - } - } - - try - { - return new GDIImageEncoder(fileSystem, logManager.GetLogger("GDI")); - } - catch - { - logger.Error("Error loading GDI. Will revert to NullImageEncoder."); - } - - return new NullImageEncoder(); - } - } -} diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index 5eb4921665..9a6cc2d6e4 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -73,25 +73,12 @@ - - - {6cfee013-6e7c-432b-ac37-cabf0880c69a} - Emby.Drawing.ImageMagick - - - {c97a239e-a96c-4d64-a844-ccf8cc30aecb} - Emby.Drawing.Net - - - {08fff49b-f175-4807-a2b5-73b0ebd9f716} - Emby.Drawing - {e383961b-9356-4d5d-8233-9a1079d03055} Emby.Server.Implementations diff --git a/MediaBrowser.ServerApplication/ImageEncoderHelper.cs b/MediaBrowser.ServerApplication/ImageEncoderHelper.cs new file mode 100644 index 0000000000..ddbde2f666 --- /dev/null +++ b/MediaBrowser.ServerApplication/ImageEncoderHelper.cs @@ -0,0 +1,48 @@ +using System; +using Emby.Drawing; +using Emby.Drawing.Net; +using Emby.Drawing.ImageMagick; +using Emby.Server.Core; +using Emby.Server.Implementations; +using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Drawing; +using MediaBrowser.Model.IO; +using MediaBrowser.Model.Logging; + +namespace MediaBrowser.Server.Startup.Common +{ + public class ImageEncoderHelper + { + public static IImageEncoder GetImageEncoder(ILogger logger, + ILogManager logManager, + IFileSystem fileSystem, + StartupOptions startupOptions, + Func httpClient, + IApplicationPaths appPaths) + { + if (!startupOptions.ContainsOption("-enablegdi")) + { + try + { + return new ImageMagickEncoder(logManager.GetLogger("ImageMagick"), appPaths, httpClient, fileSystem); + } + catch + { + logger.Error("Error loading ImageMagick. Will revert to GDI."); + } + } + + try + { + return new GDIImageEncoder(fileSystem, logManager.GetLogger("GDI")); + } + catch + { + logger.Error("Error loading GDI. Will revert to NullImageEncoder."); + } + + return new NullImageEncoder(); + } + } +} diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index b968c2fb62..749468fe2b 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -135,6 +135,7 @@ Component + Form -- cgit v1.2.3