aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
-rw-r--r--Emby.Drawing/ImageProcessor.cs27
1 files changed, 18 insertions, 9 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index 3faa3e3e9..471037801 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -16,6 +16,7 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using Emby.Drawing.Common;
namespace Emby.Drawing
{
@@ -414,18 +415,26 @@ namespace Emby.Drawing
/// <returns>ImageSize.</returns>
private ImageSize GetImageSizeInternal(string path, bool allowSlowMethod)
{
- using (var file = TagLib.File.Create(path))
+ try
{
- var image = file as TagLib.Image.File;
-
- var properties = image.Properties;
-
- return new ImageSize
+ using (var file = TagLib.File.Create(path))
{
- Height = properties.PhotoHeight,
- Width = properties.PhotoWidth
- };
+ var image = file as TagLib.Image.File;
+
+ var properties = image.Properties;
+
+ return new ImageSize
+ {
+ Height = properties.PhotoHeight,
+ Width = properties.PhotoWidth
+ };
+ }
+ }
+ catch
+ {
}
+
+ return ImageHeader.GetDimensions(path, _logger, _fileSystem);
}
private readonly Timer _saveImageSizeTimer;