mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-19 04:34:18 +01:00
support null image encoder
This commit is contained in:
@@ -9,7 +9,6 @@ using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using CommonIO;
|
||||
using MediaBrowser.Common.IO;
|
||||
|
||||
namespace Emby.Drawing.ImageMagick
|
||||
{
|
||||
@@ -27,7 +26,7 @@ namespace Emby.Drawing.ImageMagick
|
||||
_httpClient = httpClient;
|
||||
_fileSystem = fileSystem;
|
||||
|
||||
LogImageMagickVersion();
|
||||
LogVersion();
|
||||
}
|
||||
|
||||
public string[] SupportedInputFormats
|
||||
@@ -68,7 +67,7 @@ namespace Emby.Drawing.ImageMagick
|
||||
}
|
||||
}
|
||||
|
||||
private void LogImageMagickVersion()
|
||||
private void LogVersion()
|
||||
{
|
||||
_logger.Info("ImageMagick version: " + Wand.VersionString);
|
||||
TestWebp();
|
||||
@@ -88,9 +87,9 @@ namespace Emby.Drawing.ImageMagick
|
||||
wand.SaveImage(tmpPath);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch
|
||||
{
|
||||
_logger.ErrorException("Error loading webp: ", ex);
|
||||
//_logger.ErrorException("Error loading webp: ", ex);
|
||||
_webpAvailable = false;
|
||||
}
|
||||
}
|
||||
@@ -255,5 +254,15 @@ namespace Emby.Drawing.ImageMagick
|
||||
throw new ObjectDisposedException(GetType().Name);
|
||||
}
|
||||
}
|
||||
|
||||
public bool SupportsImageCollageCreation
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public bool SupportsImageEncoding
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,14 +354,14 @@ namespace Emby.Drawing.ImageMagick
|
||||
|
||||
private MagickWand BuildSquareCollageWand(List<string> paths, int width, int height)
|
||||
{
|
||||
var inputPaths = ImageHelpers.ProjectPaths(paths, 4);
|
||||
var inputPaths = ImageHelpers.ProjectPaths(paths, 3);
|
||||
using (var wandImages = new MagickWand(inputPaths.ToArray()))
|
||||
{
|
||||
var wand = new MagickWand(width, height);
|
||||
wand.OpenImage("gradient:#111111-#111111");
|
||||
using (var draw = new DrawingWand())
|
||||
{
|
||||
var iSlice = Convert.ToInt32(width * .225);
|
||||
var iSlice = Convert.ToInt32(width * .3);
|
||||
int iTrans = Convert.ToInt32(height * .25);
|
||||
int iHeight = Convert.ToInt32(height * .63);
|
||||
var horizontalImagePadding = Convert.ToInt32(width * 0.02);
|
||||
|
||||
Reference in New Issue
Block a user