diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-05-14 14:55:40 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-05-14 14:55:40 -0400 |
| commit | 4acaeecca4227380f2a1432ac682543223ec9b9e (patch) | |
| tree | 6ebaab53a1b92654817bc0f43fb6ac74b5b81e9c /Emby.Drawing/ImageProcessor.cs | |
| parent | 00507972be8a1ab4faefe6fbed110cde3516d0ae (diff) | |
update GetImageSize
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
| -rw-r--r-- | Emby.Drawing/ImageProcessor.cs | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 82181238b..ad6ca7d70 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -513,20 +513,25 @@ namespace Emby.Drawing /// <returns>ImageSize.</returns> 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 |
