mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-05 07:18:47 +01:00
update image processor
This commit is contained in:
@@ -118,5 +118,7 @@ namespace MediaBrowser.Controller.Drawing
|
||||
IImageEncoder ImageEncoder { get; set; }
|
||||
|
||||
void SaveImageSize(string path, DateTime imageDateModified, ImageSize size);
|
||||
|
||||
bool SupportsTransparency(string path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user