aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-07-31 20:37:06 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-07-31 20:37:06 -0400
commit3fa2a001c7275737e4ff4011c23ca9dc359d721d (patch)
tree0e6de4c3ff3eae1cc277a92fe0da79e214f50f2b /MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
parenta37a11c486350a35cbc9f8763c477dd189e35501 (diff)
add error handling to dlna channel support
Diffstat (limited to 'MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs')
-rw-r--r--MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs30
1 files changed, 14 insertions, 16 deletions
diff --git a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
index 912ad012d..f4a76be00 100644
--- a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
+++ b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
@@ -2,6 +2,7 @@
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Drawing;
using System.Collections.Generic;
+using System.IO;
namespace MediaBrowser.Controller.Drawing
{
@@ -34,39 +35,36 @@ namespace MediaBrowser.Controller.Drawing
public int? UnplayedCount { get; set; }
public double? PercentPlayed { get; set; }
-
+
public string BackgroundColor { get; set; }
- public bool HasDefaultOptions()
+ public bool HasDefaultOptions(string originalImagePath)
{
- return HasDefaultOptionsWithoutSize() &&
- !Width.HasValue &&
- !Height.HasValue &&
- !MaxWidth.HasValue &&
+ return HasDefaultOptionsWithoutSize(originalImagePath) &&
+ !Width.HasValue &&
+ !Height.HasValue &&
+ !MaxWidth.HasValue &&
!MaxHeight.HasValue;
}
- public bool HasDefaultOptionsWithoutSize()
+ public bool HasDefaultOptionsWithoutSize(string originalImagePath)
{
return (!Quality.HasValue || Quality.Value == 100) &&
- IsOutputFormatDefault &&
+ IsOutputFormatDefault(originalImagePath) &&
!AddPlayedIndicator &&
!PercentPlayed.HasValue &&
!UnplayedCount.HasValue &&
string.IsNullOrEmpty(BackgroundColor);
}
- private bool IsOutputFormatDefault
+ private bool IsOutputFormatDefault(string originalImagePath)
{
- get
+ if (OutputFormat == ImageOutputFormat.Original)
{
- if (OutputFormat == ImageOutputFormat.Original)
- {
- return true;
- }
-
- return false;
+ return true;
}
+
+ return string.Equals(Path.GetExtension(originalImagePath), "." + OutputFormat);
}
}
}