diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-06 16:32:26 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-06 16:32:26 -0500 |
| commit | a2cd03610fd8fedc55699f43bf4a169dc5072aa8 (patch) | |
| tree | c4120ab7a91bb4b7b2e53d311fde69d4bacb8585 /MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs | |
| parent | 221b60b662a7f85f2d7f3321831cabffe1a5e888 (diff) | |
Serve original image file when possible
Diffstat (limited to 'MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs')
| -rw-r--r-- | MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs index 76a079c57..9222a8907 100644 --- a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs +++ b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs @@ -40,5 +40,37 @@ namespace MediaBrowser.Controller.Drawing public int? PercentPlayed { get; set; } public string BackgroundColor { get; set; } + + public bool HasDefaultOptions() + { + return HasDefaultOptionsWithoutSize() && + !Width.HasValue && + !Height.HasValue && + !MaxWidth.HasValue && + !MaxHeight.HasValue; + } + + public bool HasDefaultOptionsWithoutSize() + { + return !CropWhiteSpace && + (!Quality.HasValue || Quality.Value == 100) && + IsOutputFormatDefault && + !AddPlayedIndicator && + !PercentPlayed.HasValue && + string.IsNullOrEmpty(BackgroundColor); + } + + private bool IsOutputFormatDefault + { + get + { + if (OutputFormat == ImageOutputFormat.Original) + { + return true; + } + + return false; + } + } } } |
