aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Images/ImageService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-09-19 13:45:48 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-09-19 13:45:48 -0400
commitc233f2190c8d71508b5de40c18ad21d245a10de4 (patch)
treec4e552631bcfff04bf9fa065117cc08d3242fb75 /MediaBrowser.Api/Images/ImageService.cs
parent9e91e3b2dde25c466a82a53c2f83beae69dbc7b9 (diff)
fixes #518 - Add api param for watched indicator on images
Diffstat (limited to 'MediaBrowser.Api/Images/ImageService.cs')
-rw-r--r--MediaBrowser.Api/Images/ImageService.cs24
1 files changed, 23 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs
index 9f1c235ad..0a76175fd 100644
--- a/MediaBrowser.Api/Images/ImageService.cs
+++ b/MediaBrowser.Api/Images/ImageService.cs
@@ -747,7 +747,7 @@ namespace MediaBrowser.Api.Images
throw new ResourceNotFoundException(string.Format("File not found: {0}", imagePath));
}
- var contentType = MimeTypes.GetMimeType(imagePath);
+ var contentType = GetMimeType(request.Format, imagePath);
var cacheGuid = _imageProcessor.GetImageCacheTag(item, request.Type, imagePath, originalFileImageDateModified, supportedImageEnhancers);
@@ -774,6 +774,28 @@ namespace MediaBrowser.Api.Images
}, contentType);
}
+ private string GetMimeType(ImageOutputFormat format, string path)
+ {
+ if (format == ImageOutputFormat.Bmp)
+ {
+ return MimeTypes.GetMimeType("i.bmp");
+ }
+ if (format == ImageOutputFormat.Gif)
+ {
+ return MimeTypes.GetMimeType("i.gif");
+ }
+ if (format == ImageOutputFormat.Jpg)
+ {
+ return MimeTypes.GetMimeType("i.jpg");
+ }
+ if (format == ImageOutputFormat.Png)
+ {
+ return MimeTypes.GetMimeType("i.png");
+ }
+
+ return MimeTypes.GetMimeType(path);
+ }
+
/// <summary>
/// Gets the image path.
/// </summary>