mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-28 11:28:27 +01:00
rework image libs
This commit is contained in:
@@ -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<IHttpClient> 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,25 +73,12 @@
|
||||
<Compile Include="Cryptography\X509Extension.cs" />
|
||||
<Compile Include="Cryptography\X509Extensions.cs" />
|
||||
<Compile Include="Cryptography\X520Attributes.cs" />
|
||||
<Compile Include="ImageEncoderHelper.cs" />
|
||||
<Compile Include="IO\MemoryStreamProvider.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SystemEvents.cs" />
|
||||
<Compile Include="UpdateLevelHelper.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Emby.Drawing.ImageMagick\Emby.Drawing.ImageMagick.csproj">
|
||||
<Project>{6cfee013-6e7c-432b-ac37-cabf0880c69a}</Project>
|
||||
<Name>Emby.Drawing.ImageMagick</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Emby.Drawing.Net\Emby.Drawing.Net.csproj">
|
||||
<Project>{c97a239e-a96c-4d64-a844-ccf8cc30aecb}</Project>
|
||||
<Name>Emby.Drawing.Net</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Emby.Drawing\Emby.Drawing.csproj">
|
||||
<Project>{08fff49b-f175-4807-a2b5-73b0ebd9f716}</Project>
|
||||
<Name>Emby.Drawing</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Emby.Server.Implementations\Emby.Server.Implementations.csproj">
|
||||
<Project>{e383961b-9356-4d5d-8233-9a1079d03055}</Project>
|
||||
<Name>Emby.Server.Implementations</Name>
|
||||
|
||||
Reference in New Issue
Block a user