diff --git a/MediaBrowser.Server.Mac/Main.cs b/MediaBrowser.Server.Mac/Main.cs index 932ff61055..9484a20623 100644 --- a/MediaBrowser.Server.Mac/Main.cs +++ b/MediaBrowser.Server.Mac/Main.cs @@ -32,7 +32,9 @@ using Mono.Unix.Native; using MediaBrowser.Model.System; using MediaBrowser.Model.IO; using Emby.Server.Core.Logging; -using Emby.Drawing.Net; +using Emby.Drawing.Skia; +using MediaBrowser.Controller.Drawing; +using MediaBrowser.Model.Drawing; namespace MediaBrowser.Server.Mac { @@ -112,7 +114,7 @@ namespace MediaBrowser.Server.Mac _fileSystem = fileSystem; - var imageEncoder = new GDIImageEncoder(fileSystem, logManager.GetLogger("GDI")); + var imageEncoder = GetImageEncoder(appPaths, fileSystem, logManager); AppHost = new MacAppHost(appPaths, logManager, @@ -138,6 +140,18 @@ namespace MediaBrowser.Server.Mac Task.Run (() => StartServer(CancellationToken.None)); } + private static IImageEncoder GetImageEncoder(ServerApplicationPaths appPaths, IFileSystem fileSystem, ILogManager logManager) + { + try + { + return new SkiaEncoder(logManager.GetLogger("Skia"), appPaths, () => AppHost.HttpClient, fileSystem); + } + catch (Exception ex) + { + return new GDIImageEncoder(fileSystem, logManager.GetLogger("GDI")); + } + } + private static void GenerateCertificate(string certPath, string certHost, string certPassword) { CertificateGenerator.CreateSelfSignCertificatePfx(certPath, certHost, certPassword, _logger);