dispose stream in PhotoProvider

This commit is contained in:
Luke Pulverenti 2017-05-14 14:55:05 -04:00
parent 992ad9c2d9
commit 00507972be

View File

@ -35,7 +35,9 @@ namespace Emby.Photos
try
{
using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(item.Path), _fileSystem.OpenRead(item.Path), null)))
using (var fileStream = _fileSystem.OpenRead(item.Path))
{
using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(item.Path), fileStream, null)))
{
var image = file as TagLib.Image.File;
@ -142,6 +144,7 @@ namespace Emby.Photos
}
}
}
}
catch (Exception e)
{
_logger.ErrorException("Image Provider - Error reading image tag for {0}", e, item.Path);