update image magick sharp

This commit is contained in:
Luke Pulverenti
2015-03-02 00:16:29 -05:00
parent 3d22c48670
commit 0d8636d859
17 changed files with 111 additions and 46 deletions

View File

@@ -350,9 +350,9 @@ namespace MediaBrowser.Server.Implementations.Drawing
}
/// <summary>
/// Increment this when indicator drawings change
/// Increment this when there's a change requiring caches to be invalidated
/// </summary>
private const string IndicatorVersion = "2";
private const string Version = "3";
/// <summary>
/// Gets the cache file path based on a set of parameters
@@ -371,29 +371,19 @@ namespace MediaBrowser.Server.Implementations.Drawing
filename += "f=" + format;
var hasIndicator = false;
if (addPlayedIndicator)
{
filename += "pl=true";
hasIndicator = true;
}
if (percentPlayed > 0)
{
filename += "p=" + percentPlayed;
hasIndicator = true;
}
if (unwatchedCount.HasValue)
{
filename += "p=" + unwatchedCount.Value;
hasIndicator = true;
}
if (hasIndicator)
{
filename += "iv=" + IndicatorVersion;
}
if (!string.IsNullOrEmpty(backgroundColor))
@@ -401,6 +391,8 @@ namespace MediaBrowser.Server.Implementations.Drawing
filename += "b=" + backgroundColor;
}
filename += "v=" + Version;
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLower());
}
@@ -671,30 +663,6 @@ namespace MediaBrowser.Server.Implementations.Drawing
return enhancedImagePath;
}
private ImageFormat GetFormat(string path)
{
var extension = Path.GetExtension(path);
if (string.Equals(extension, ".png", StringComparison.OrdinalIgnoreCase))
{
return ImageFormat.Png;
}
if (string.Equals(extension, ".gif", StringComparison.OrdinalIgnoreCase))
{
return ImageFormat.Gif;
}
if (string.Equals(extension, ".webp", StringComparison.OrdinalIgnoreCase))
{
return ImageFormat.Webp;
}
if (string.Equals(extension, ".bmp", StringComparison.OrdinalIgnoreCase))
{
return ImageFormat.Bmp;
}
return ImageFormat.Jpg;
}
/// <summary>
/// Executes the image enhancers.
/// </summary>