diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index 4095e4176b..f919904422 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -422,10 +422,10 @@ namespace Emby.Drawing
public ImageSize GetImageSize(BaseItem item, ItemImageInfo info)
{
- return GetImageSize(item, info, false, true);
+ return GetImageSize(item, info, true);
}
- public ImageSize GetImageSize(BaseItem item, ItemImageInfo info, bool allowSlowMethods, bool updateItem)
+ public ImageSize GetImageSize(BaseItem item, ItemImageInfo info, bool updateItem)
{
var width = info.Width;
var height = info.Height;
@@ -442,7 +442,7 @@ namespace Emby.Drawing
var path = info.Path;
_logger.LogInformation("Getting image size for item {0} {1}", item.GetType().Name, path);
- var size = GetImageSize(path, allowSlowMethods);
+ var size = GetImageSize(path);
info.Height = Convert.ToInt32(size.Height);
info.Width = Convert.ToInt32(size.Width);
@@ -455,43 +455,26 @@ namespace Emby.Drawing
return size;
}
- public ImageSize GetImageSize(string path)
- {
- return GetImageSize(path, true);
- }
-
///
/// Gets the size of the image.
///
- private ImageSize GetImageSize(string path, bool allowSlowMethod)
+ public ImageSize GetImageSize(string path)
{
if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException(nameof(path));
}
- try
- {
- using (var s = new SKFileStream(path))
- using (var codec = SKCodec.Create(s))
- {
- var info = codec.Info;
- return new ImageSize
- {
- Height = info.Height,
- Width = info.Width
- };
- }
- }
- catch
- {
- if (!allowSlowMethod)
+ using (var s = new SKFileStream(path))
+ using (var codec = SKCodec.Create(s))
{
- throw;
+ var info = codec.Info;
+ return new ImageSize
+ {
+ Height = info.Height,
+ Width = info.Width
+ };
}
- }
-
- return _imageEncoder.GetImageSize(path);
}
///
diff --git a/Emby.Photos/PhotoProvider.cs b/Emby.Photos/PhotoProvider.cs
index 4fcd418f0b..4e483ad5b5 100644
--- a/Emby.Photos/PhotoProvider.cs
+++ b/Emby.Photos/PhotoProvider.cs
@@ -181,7 +181,7 @@ namespace Emby.Photos
try
{
- var size = _imageProcessor.GetImageSize(item, img, false, false);
+ var size = _imageProcessor.GetImageSize(item, img, false);
if (size.Width > 0 && size.Height > 0)
{
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs
index 369e9781f1..26ac8d40e3 100644
--- a/MediaBrowser.Api/Images/ImageService.cs
+++ b/MediaBrowser.Api/Images/ImageService.cs
@@ -328,7 +328,7 @@ namespace MediaBrowser.Api.Images
var fileInfo = _fileSystem.GetFileInfo(info.Path);
length = fileInfo.Length;
- var size = _imageProcessor.GetImageSize(item, info, true, true);
+ var size = _imageProcessor.GetImageSize(item, info, true);
width = Convert.ToInt32(size.Width);
height = Convert.ToInt32(size.Height);
diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs
index c5d30c4267..2cafc9ec19 100644
--- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs
+++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs
@@ -35,7 +35,7 @@ namespace MediaBrowser.Controller.Drawing
/// ImageSize.
ImageSize GetImageSize(BaseItem item, ItemImageInfo info);
- ImageSize GetImageSize(BaseItem item, ItemImageInfo info, bool allowSlowMethods, bool updateItem);
+ ImageSize GetImageSize(BaseItem item, ItemImageInfo info, bool updateItem);
///
/// Adds the parts.