From 4acaeecca4227380f2a1432ac682543223ec9b9e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 14 May 2017 14:55:40 -0400 Subject: [PATCH] update GetImageSize --- Emby.Drawing/ImageProcessor.cs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 82181238bb..ad6ca7d70b 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -513,20 +513,25 @@ namespace Emby.Drawing /// ImageSize. private ImageSize GetImageSizeInternal(string path, bool allowSlowMethod) { - // Can't use taglib because it keeps a lock on the file //try //{ - // using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(path), _fileSystem.OpenRead(path), null))) + // using (var fileStream = _fileSystem.OpenRead(path)) // { - // var image = file as TagLib.Image.File; - - // var properties = image.Properties; - - // return new ImageSize + // using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(path), fileStream, null))) // { - // Height = properties.PhotoHeight, - // Width = properties.PhotoWidth - // }; + // var image = file as TagLib.Image.File; + + // if (image != null) + // { + // var properties = image.Properties; + + // return new ImageSize + // { + // Height = properties.PhotoHeight, + // Width = properties.PhotoWidth + // }; + // } + // } // } //} //catch