aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Providers/ILocalImageProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Providers/ILocalImageProvider.cs')
-rw-r--r--MediaBrowser.Controller/Providers/ILocalImageProvider.cs24
1 files changed, 20 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Providers/ILocalImageProvider.cs b/MediaBrowser.Controller/Providers/ILocalImageProvider.cs
index ed7cdc8b2..ec24e1d60 100644
--- a/MediaBrowser.Controller/Providers/ILocalImageProvider.cs
+++ b/MediaBrowser.Controller/Providers/ILocalImageProvider.cs
@@ -1,6 +1,7 @@
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
@@ -15,14 +16,14 @@ namespace MediaBrowser.Controller.Providers
{
}
- public interface IImageFileProvider : ILocalImageProvider
+ public interface ILocalImageFileProvider : ILocalImageProvider
{
- List<LocalImageInfo> GetImages(IHasImages item);
+ List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService);
}
public class LocalImageInfo
{
- public string Path { get; set; }
+ public FileInfo FileInfo { get; set; }
public ImageType Type { get; set; }
}
@@ -60,7 +61,22 @@ namespace MediaBrowser.Controller.Providers
public void SetFormatFromMimeType(string mimeType)
{
-
+ if (mimeType.EndsWith("gif", StringComparison.OrdinalIgnoreCase))
+ {
+ Format = ImageFormat.Gif;
+ }
+ else if (mimeType.EndsWith("bmp", StringComparison.OrdinalIgnoreCase))
+ {
+ Format = ImageFormat.Bmp;
+ }
+ else if (mimeType.EndsWith("png", StringComparison.OrdinalIgnoreCase))
+ {
+ Format = ImageFormat.Png;
+ }
+ else
+ {
+ Format = ImageFormat.Jpg;
+ }
}
}
}