stub out ForegroundLayer param
This commit is contained in:
parent
ae8060d4ad
commit
c7fe8587cb
|
@ -155,6 +155,7 @@ namespace Emby.Drawing.ImageMagick
|
||||||
AutoOrientImage(originalImage);
|
AutoOrientImage(originalImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddForegroundLayer(originalImage, options);
|
||||||
DrawIndicator(originalImage, width, height, options);
|
DrawIndicator(originalImage, width, height, options);
|
||||||
|
|
||||||
originalImage.CurrentImage.CompressionQuality = quality;
|
originalImage.CurrentImage.CompressionQuality = quality;
|
||||||
|
@ -177,6 +178,8 @@ namespace Emby.Drawing.ImageMagick
|
||||||
}
|
}
|
||||||
|
|
||||||
wand.CurrentImage.CompositeImage(originalImage, CompositeOperator.OverCompositeOp, 0, 0);
|
wand.CurrentImage.CompositeImage(originalImage, CompositeOperator.OverCompositeOp, 0, 0);
|
||||||
|
|
||||||
|
AddForegroundLayer(wand, options);
|
||||||
DrawIndicator(wand, width, height, options);
|
DrawIndicator(wand, width, height, options);
|
||||||
|
|
||||||
wand.CurrentImage.CompressionQuality = quality;
|
wand.CurrentImage.CompressionQuality = quality;
|
||||||
|
@ -189,6 +192,16 @@ namespace Emby.Drawing.ImageMagick
|
||||||
SaveDelay();
|
SaveDelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AddForegroundLayer(MagickWand wand, ImageProcessingOptions options)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(options.ForegroundLayer))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
private void AutoOrientImage(MagickWand wand)
|
private void AutoOrientImage(MagickWand wand)
|
||||||
{
|
{
|
||||||
wand.CurrentImage.AutoOrientImage();
|
wand.CurrentImage.AutoOrientImage();
|
||||||
|
|
|
@ -473,7 +473,7 @@ namespace Emby.Drawing
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the cache file path based on a set of parameters
|
/// Gets the cache file path based on a set of parameters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private string GetCacheFilePath(string originalPath, ImageSize outputSize, int quality, DateTime dateModified, ImageFormat format, bool addPlayedIndicator, double percentPlayed, int? unwatchedCount, string backgroundColor)
|
private string GetCacheFilePath(string originalPath, ImageSize outputSize, int quality, DateTime dateModified, ImageFormat format, bool addPlayedIndicator, double percentPlayed, int? unwatchedCount, string backgroundColor, string foregroundLayer)
|
||||||
{
|
{
|
||||||
var filename = originalPath;
|
var filename = originalPath;
|
||||||
|
|
||||||
|
@ -507,6 +507,11 @@ namespace Emby.Drawing
|
||||||
filename += "b=" + backgroundColor;
|
filename += "b=" + backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(foregroundLayer))
|
||||||
|
{
|
||||||
|
filename += "fl=" + foregroundLayer;
|
||||||
|
}
|
||||||
|
|
||||||
filename += "v=" + Version;
|
filename += "v=" + Version;
|
||||||
|
|
||||||
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLower());
|
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLower());
|
||||||
|
|
|
@ -67,6 +67,9 @@ namespace MediaBrowser.Api.Images
|
||||||
[ApiMember(Name = "BackgroundColor", Description = "Optional. Apply a background color for transparent images.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
|
[ApiMember(Name = "BackgroundColor", Description = "Optional. Apply a background color for transparent images.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
|
||||||
public string BackgroundColor { get; set; }
|
public string BackgroundColor { get; set; }
|
||||||
|
|
||||||
|
[ApiMember(Name = "ForegroundLayer", Description = "Optional. Apply a foreground layer on top of the image.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
|
||||||
|
public string ForegroundLayer { get; set; }
|
||||||
|
|
||||||
public ImageRequest()
|
public ImageRequest()
|
||||||
{
|
{
|
||||||
EnableImageEnhancers = true;
|
EnableImageEnhancers = true;
|
||||||
|
|
|
@ -624,6 +624,7 @@ namespace MediaBrowser.Api.Images
|
||||||
PercentPlayed = request.PercentPlayed ?? 0,
|
PercentPlayed = request.PercentPlayed ?? 0,
|
||||||
UnplayedCount = request.UnplayedCount,
|
UnplayedCount = request.UnplayedCount,
|
||||||
BackgroundColor = request.BackgroundColor,
|
BackgroundColor = request.BackgroundColor,
|
||||||
|
ForegroundLayer = request.ForegroundLayer,
|
||||||
SupportedOutputFormats = supportedFormats
|
SupportedOutputFormats = supportedFormats
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
public double PercentPlayed { get; set; }
|
public double PercentPlayed { get; set; }
|
||||||
|
|
||||||
public string BackgroundColor { get; set; }
|
public string BackgroundColor { get; set; }
|
||||||
|
public string ForegroundLayer { get; set; }
|
||||||
|
|
||||||
public bool HasDefaultOptions(string originalImagePath)
|
public bool HasDefaultOptions(string originalImagePath)
|
||||||
{
|
{
|
||||||
|
@ -83,7 +84,8 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
!AddPlayedIndicator &&
|
!AddPlayedIndicator &&
|
||||||
PercentPlayed.Equals(0) &&
|
PercentPlayed.Equals(0) &&
|
||||||
!UnplayedCount.HasValue &&
|
!UnplayedCount.HasValue &&
|
||||||
string.IsNullOrEmpty(BackgroundColor);
|
string.IsNullOrEmpty(BackgroundColor) &&
|
||||||
|
string.IsNullOrEmpty(ForegroundLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsFormatSupported(string originalImagePath)
|
private bool IsFormatSupported(string originalImagePath)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user