update image processor

This commit is contained in:
Luke Pulverenti
2017-09-07 14:17:18 -04:00
parent ab3e79e6aa
commit eb63e0d264
14 changed files with 428 additions and 89 deletions

View File

@@ -118,5 +118,7 @@ namespace MediaBrowser.Controller.Drawing
IImageEncoder ImageEncoder { get; set; }
void SaveImageSize(string path, DateTime imageDateModified, ImageSize size);
bool SupportsTransparency(string path);
}
}

View File

@@ -10,6 +10,11 @@ namespace MediaBrowser.Controller.Drawing
{
public class ImageProcessingOptions
{
public ImageProcessingOptions()
{
RequiresAutoOrientation = true;
}
public string ItemId { get; set; }
public string ItemType { get; set; }
public IHasMetadata Item { get; set; }
@@ -32,7 +37,7 @@ namespace MediaBrowser.Controller.Drawing
public List<IImageEnhancer> Enhancers { get; set; }
public List<ImageFormat> SupportedOutputFormats { get; set; }
public ImageFormat[] SupportedOutputFormats { get; set; }
public bool AddPlayedIndicator { get; set; }
@@ -43,6 +48,7 @@ namespace MediaBrowser.Controller.Drawing
public string BackgroundColor { get; set; }
public string ForegroundLayer { get; set; }
public bool RequiresAutoOrientation { get; set; }
public bool HasDefaultOptions(string originalImagePath)
{

View File

@@ -80,15 +80,43 @@ namespace MediaBrowser.Controller.Entities.Movies
protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
{
if (IsLegacyBoxSet)
{
return base.GetNonCachedChildren(directoryService);
}
return new List<BaseItem>();
}
protected override List<BaseItem> LoadChildren()
{
if (IsLegacyBoxSet)
{
return base.LoadChildren();
}
// Save a trip to the database
return new List<BaseItem>();
}
[IgnoreDataMember]
private bool IsLegacyBoxSet
{
get
{
if (string.IsNullOrWhiteSpace(Path))
{
return false;
}
if (LinkedChildren.Length > 0)
{
return false;
}
return !FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, Path);
}
}
[IgnoreDataMember]
public override bool IsPreSorted
{

View File

@@ -39,6 +39,8 @@ namespace MediaBrowser.Controller.Providers
/// <returns>ImageSize.</returns>
ImageSize GetEnhancedImageSize(IHasMetadata item, ImageType imageType, int imageIndex, ImageSize originalImageSize);
EnhancedImageInfo GetEnhancedImageInfo(IHasMetadata item, string inputFile, ImageType imageType, int imageIndex);
/// <summary>
/// Enhances the image async.
/// </summary>
@@ -51,4 +53,9 @@ namespace MediaBrowser.Controller.Providers
/// <exception cref="System.ArgumentNullException"></exception>
Task EnhanceImageAsync(IHasMetadata item, string inputFile, string outputFile, ImageType imageType, int imageIndex);
}
public class EnhancedImageInfo
{
public bool RequiresTransparency { get; set; }
}
}