From bcaf9bd19ce4d199cf20315fd486e3a297e1ff1f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 24 Jun 2017 14:29:23 -0400 Subject: [PATCH] add skia error handling --- Emby.Drawing.Skia/SkiaEncoder.cs | 8 ++++---- Emby.Drawing/ImageProcessor.cs | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Emby.Drawing.Skia/SkiaEncoder.cs b/Emby.Drawing.Skia/SkiaEncoder.cs index 2c7dc58c23..35a9bd8aa1 100644 --- a/Emby.Drawing.Skia/SkiaEncoder.cs +++ b/Emby.Drawing.Skia/SkiaEncoder.cs @@ -63,15 +63,15 @@ namespace Emby.Drawing.Skia private void LogVersion() { + // test an operation that requires the native library + SKPMColor.PreMultiply(SKColors.Black); + _logger.Info("SkiaSharp version: " + GetVersion()); } public static string GetVersion() { - using (var bitmap = new SKBitmap()) - { - return typeof(SKBitmap).GetTypeInfo().Assembly.GetName().Version.ToString(); - } + return typeof(SKBitmap).GetTypeInfo().Assembly.GetName().Version.ToString(); } private static bool IsWhiteSpace(SKColor color) diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index eb5e0d82a9..be45912235 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -410,6 +410,11 @@ namespace Emby.Drawing return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLower()); } + public ImageSize GetImageSize(ItemImageInfo info, bool allowSlowMethods) + { + return GetImageSize(info.Path, info.DateModified, allowSlowMethods); + } + public ImageSize GetImageSize(ItemImageInfo info) { return GetImageSize(info.Path, info.DateModified, false);