add skia error handling

pull/1154/head
Luke Pulverenti 8 years ago
parent 023952d04d
commit bcaf9bd19c

@ -63,16 +63,16 @@ namespace Emby.Drawing.Skia
private void LogVersion() private void LogVersion()
{ {
// test an operation that requires the native library
SKPMColor.PreMultiply(SKColors.Black);
_logger.Info("SkiaSharp version: " + GetVersion()); _logger.Info("SkiaSharp version: " + GetVersion());
} }
public static string 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) private static bool IsWhiteSpace(SKColor color)
{ {

@ -410,6 +410,11 @@ namespace Emby.Drawing
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLower()); 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) public ImageSize GetImageSize(ItemImageInfo info)
{ {
return GetImageSize(info.Path, info.DateModified, false); return GetImageSize(info.Path, info.DateModified, false);

Loading…
Cancel
Save