mirror of https://github.com/jellyfin/jellyfin.git
Document all public/internal members of Emby.Drawing
Forces all new public/internal members to be documented. Enables TreatWarningsAsErrors for Emby.Drawing
This commit is contained in:
parent
1ad67e223f
commit
838e5d05d5
|
@ -11,6 +11,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -22,42 +22,47 @@ using Microsoft.Extensions.Logging;
|
||||||
namespace Emby.Drawing
|
namespace Emby.Drawing
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class ImageProcessor
|
/// Class ImageProcessor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ImageProcessor : IImageProcessor, IDisposable
|
public class ImageProcessor : IImageProcessor, IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
// Increment this when there's a change requiring caches to be invalidated
|
||||||
/// The us culture
|
private const string Version = "3";
|
||||||
/// </summary>
|
|
||||||
protected readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
|
||||||
|
|
||||||
/// <summary>
|
private static readonly HashSet<string> _transparentImageTypes
|
||||||
/// Gets the list of currently registered image processors
|
= new HashSet<string>(StringComparer.OrdinalIgnoreCase) { ".png", ".webp", ".gif" };
|
||||||
/// Image processors are specialized metadata providers that run after the normal ones
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The image enhancers.</value>
|
|
||||||
public IImageEnhancer[] ImageEnhancers { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _logger
|
/// The _logger
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
private readonly IFileSystem _fileSystem;
|
private readonly IFileSystem _fileSystem;
|
||||||
private readonly IServerApplicationPaths _appPaths;
|
private readonly IServerApplicationPaths _appPaths;
|
||||||
private IImageEncoder _imageEncoder;
|
private IImageEncoder _imageEncoder;
|
||||||
private readonly Func<ILibraryManager> _libraryManager;
|
private readonly Func<ILibraryManager> _libraryManager;
|
||||||
private readonly Func<IMediaEncoder> _mediaEncoder;
|
private readonly Func<IMediaEncoder> _mediaEncoder;
|
||||||
|
|
||||||
|
private readonly Dictionary<string, LockInfo> _locks = new Dictionary<string, LockInfo>();
|
||||||
|
private bool _disposed = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="logger"></param>
|
||||||
|
/// <param name="appPaths"></param>
|
||||||
|
/// <param name="fileSystem"></param>
|
||||||
|
/// <param name="imageEncoder"></param>
|
||||||
|
/// <param name="libraryManager"></param>
|
||||||
|
/// <param name="mediaEncoder"></param>
|
||||||
public ImageProcessor(
|
public ImageProcessor(
|
||||||
ILoggerFactory loggerFactory,
|
ILogger<ImageProcessor> logger,
|
||||||
IServerApplicationPaths appPaths,
|
IServerApplicationPaths appPaths,
|
||||||
IFileSystem fileSystem,
|
IFileSystem fileSystem,
|
||||||
IImageEncoder imageEncoder,
|
IImageEncoder imageEncoder,
|
||||||
Func<ILibraryManager> libraryManager,
|
Func<ILibraryManager> libraryManager,
|
||||||
Func<IMediaEncoder> mediaEncoder)
|
Func<IMediaEncoder> mediaEncoder)
|
||||||
{
|
{
|
||||||
_logger = loggerFactory.CreateLogger(nameof(ImageProcessor));
|
_logger = logger;
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
_imageEncoder = imageEncoder;
|
_imageEncoder = imageEncoder;
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
|
@ -69,20 +74,11 @@ namespace Emby.Drawing
|
||||||
ImageHelper.ImageProcessor = this;
|
ImageHelper.ImageProcessor = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IImageEncoder ImageEncoder
|
private string ResizedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "resized-images");
|
||||||
{
|
|
||||||
get => _imageEncoder;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
_imageEncoder = value;
|
private string EnhancedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "enhanced-images");
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public IReadOnlyCollection<string> SupportedInputFormats =>
|
public IReadOnlyCollection<string> SupportedInputFormats =>
|
||||||
new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
{
|
||||||
|
@ -115,18 +111,20 @@ namespace Emby.Drawing
|
||||||
"wbmp"
|
"wbmp"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IReadOnlyCollection<IImageEnhancer> ImageEnhancers { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool SupportsImageCollageCreation => _imageEncoder.SupportsImageCollageCreation;
|
public bool SupportsImageCollageCreation => _imageEncoder.SupportsImageCollageCreation;
|
||||||
|
|
||||||
private string ResizedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "resized-images");
|
/// <inheritdoc />
|
||||||
|
public IImageEncoder ImageEncoder
|
||||||
private string EnhancedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "enhanced-images");
|
|
||||||
|
|
||||||
public void AddParts(IEnumerable<IImageEnhancer> enhancers)
|
|
||||||
{
|
{
|
||||||
ImageEnhancers = enhancers.ToArray();
|
get => _imageEncoder;
|
||||||
|
set => _imageEncoder = value ?? throw new ArgumentNullException(nameof(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public async Task ProcessImage(ImageProcessingOptions options, Stream toStream)
|
public async Task ProcessImage(ImageProcessingOptions options, Stream toStream)
|
||||||
{
|
{
|
||||||
var file = await ProcessImage(options).ConfigureAwait(false);
|
var file = await ProcessImage(options).ConfigureAwait(false);
|
||||||
|
@ -137,15 +135,15 @@ namespace Emby.Drawing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats()
|
public IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats()
|
||||||
=> _imageEncoder.SupportedOutputFormats;
|
=> _imageEncoder.SupportedOutputFormats;
|
||||||
|
|
||||||
private static readonly HashSet<string> TransparentImageTypes
|
/// <inheritdoc />
|
||||||
= new HashSet<string>(StringComparer.OrdinalIgnoreCase) { ".png", ".webp", ".gif" };
|
|
||||||
|
|
||||||
public bool SupportsTransparency(string path)
|
public bool SupportsTransparency(string path)
|
||||||
=> TransparentImageTypes.Contains(Path.GetExtension(path));
|
=> _transparentImageTypes.Contains(Path.GetExtension(path));
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public async Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options)
|
public async Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options)
|
||||||
{
|
{
|
||||||
if (options == null)
|
if (options == null)
|
||||||
|
@ -187,9 +185,9 @@ namespace Emby.Drawing
|
||||||
}
|
}
|
||||||
|
|
||||||
dateModified = supportedImageInfo.dateModified;
|
dateModified = supportedImageInfo.dateModified;
|
||||||
bool requiresTransparency = TransparentImageTypes.Contains(Path.GetExtension(originalImagePath));
|
bool requiresTransparency = _transparentImageTypes.Contains(Path.GetExtension(originalImagePath));
|
||||||
|
|
||||||
if (options.Enhancers.Length > 0)
|
if (options.Enhancers.Count > 0)
|
||||||
{
|
{
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
|
@ -279,7 +277,7 @@ namespace Emby.Drawing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ImageFormat GetOutputFormat(ImageFormat[] clientSupportedFormats, bool requiresTransparency)
|
private ImageFormat GetOutputFormat(IReadOnlyCollection<ImageFormat> clientSupportedFormats, bool requiresTransparency)
|
||||||
{
|
{
|
||||||
var serverFormats = GetSupportedImageOutputFormats();
|
var serverFormats = GetSupportedImageOutputFormats();
|
||||||
|
|
||||||
|
@ -320,11 +318,6 @@ namespace Emby.Drawing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Increment this when there's a change requiring caches to be invalidated
|
|
||||||
/// </summary>
|
|
||||||
private const string Version = "3";
|
|
||||||
|
|
||||||
/// <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>
|
||||||
|
@ -372,9 +365,11 @@ namespace Emby.Drawing
|
||||||
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLowerInvariant());
|
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLowerInvariant());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info)
|
public ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info)
|
||||||
=> GetImageDimensions(item, info, true);
|
=> GetImageDimensions(item, info, true);
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info, bool updateItem)
|
public ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info, bool updateItem)
|
||||||
{
|
{
|
||||||
int width = info.Width;
|
int width = info.Width;
|
||||||
|
@ -400,26 +395,19 @@ namespace Emby.Drawing
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc />
|
||||||
/// Gets the size of the image.
|
|
||||||
/// </summary>
|
|
||||||
public ImageDimensions GetImageDimensions(string path)
|
public ImageDimensions GetImageDimensions(string path)
|
||||||
=> _imageEncoder.GetImageSize(path);
|
=> _imageEncoder.GetImageSize(path);
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc />
|
||||||
/// Gets the image cache tag.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item">The item.</param>
|
|
||||||
/// <param name="image">The image.</param>
|
|
||||||
/// <returns>Guid.</returns>
|
|
||||||
/// <exception cref="ArgumentNullException">item</exception>
|
|
||||||
public string GetImageCacheTag(BaseItem item, ItemImageInfo image)
|
public string GetImageCacheTag(BaseItem item, ItemImageInfo image)
|
||||||
{
|
{
|
||||||
var supportedEnhancers = GetSupportedEnhancers(item, image.Type);
|
var supportedEnhancers = GetSupportedEnhancers(item, image.Type).ToArray();
|
||||||
|
|
||||||
return GetImageCacheTag(item, image, supportedEnhancers);
|
return GetImageCacheTag(item, image, supportedEnhancers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string GetImageCacheTag(BaseItem item, ChapterInfo chapter)
|
public string GetImageCacheTag(BaseItem item, ChapterInfo chapter)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -437,22 +425,15 @@ namespace Emby.Drawing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc />
|
||||||
/// Gets the image cache tag.
|
public string GetImageCacheTag(BaseItem item, ItemImageInfo image, IReadOnlyCollection<IImageEnhancer> imageEnhancers)
|
||||||
/// </summary>
|
|
||||||
/// <param name="item">The item.</param>
|
|
||||||
/// <param name="image">The image.</param>
|
|
||||||
/// <param name="imageEnhancers">The image enhancers.</param>
|
|
||||||
/// <returns>Guid.</returns>
|
|
||||||
/// <exception cref="ArgumentNullException">item</exception>
|
|
||||||
public string GetImageCacheTag(BaseItem item, ItemImageInfo image, IImageEnhancer[] imageEnhancers)
|
|
||||||
{
|
{
|
||||||
string originalImagePath = image.Path;
|
string originalImagePath = image.Path;
|
||||||
DateTime dateModified = image.DateModified;
|
DateTime dateModified = image.DateModified;
|
||||||
ImageType imageType = image.Type;
|
ImageType imageType = image.Type;
|
||||||
|
|
||||||
// Optimization
|
// Optimization
|
||||||
if (imageEnhancers.Length == 0)
|
if (imageEnhancers.Count == 0)
|
||||||
{
|
{
|
||||||
return (originalImagePath + dateModified.Ticks).GetMD5().ToString("N", CultureInfo.InvariantCulture);
|
return (originalImagePath + dateModified.Ticks).GetMD5().ToString("N", CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
@ -480,7 +461,7 @@ namespace Emby.Drawing
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string filename = (originalImagePath + dateModified.Ticks.ToString(UsCulture)).GetMD5().ToString("N", CultureInfo.InvariantCulture);
|
string filename = (originalImagePath + dateModified.Ticks.ToString(CultureInfo.InvariantCulture)).GetMD5().ToString("N", CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
string cacheExtension = _mediaEncoder().SupportsEncoder("libwebp") ? ".webp" : ".png";
|
string cacheExtension = _mediaEncoder().SupportsEncoder("libwebp") ? ".webp" : ".png";
|
||||||
var outputPath = Path.Combine(_appPaths.ImageCachePath, "converted-images", filename + cacheExtension);
|
var outputPath = Path.Combine(_appPaths.ImageCachePath, "converted-images", filename + cacheExtension);
|
||||||
|
@ -507,16 +488,10 @@ namespace Emby.Drawing
|
||||||
return (originalImagePath, dateModified);
|
return (originalImagePath, dateModified);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc />
|
||||||
/// Gets the enhanced image.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item">The item.</param>
|
|
||||||
/// <param name="imageType">Type of the image.</param>
|
|
||||||
/// <param name="imageIndex">Index of the image.</param>
|
|
||||||
/// <returns>Task{System.String}.</returns>
|
|
||||||
public async Task<string> GetEnhancedImage(BaseItem item, ImageType imageType, int imageIndex)
|
public async Task<string> GetEnhancedImage(BaseItem item, ImageType imageType, int imageIndex)
|
||||||
{
|
{
|
||||||
var enhancers = GetSupportedEnhancers(item, imageType);
|
var enhancers = GetSupportedEnhancers(item, imageType).ToArray();
|
||||||
|
|
||||||
ItemImageInfo imageInfo = item.GetImageInfo(imageType, imageIndex);
|
ItemImageInfo imageInfo = item.GetImageInfo(imageType, imageIndex);
|
||||||
|
|
||||||
|
@ -532,7 +507,7 @@ namespace Emby.Drawing
|
||||||
bool inputImageSupportsTransparency,
|
bool inputImageSupportsTransparency,
|
||||||
BaseItem item,
|
BaseItem item,
|
||||||
int imageIndex,
|
int imageIndex,
|
||||||
IImageEnhancer[] enhancers,
|
IReadOnlyCollection<IImageEnhancer> enhancers,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var originalImagePath = image.Path;
|
var originalImagePath = image.Path;
|
||||||
|
@ -573,6 +548,7 @@ namespace Emby.Drawing
|
||||||
/// <param name="imageIndex">Index of the image.</param>
|
/// <param name="imageIndex">Index of the image.</param>
|
||||||
/// <param name="supportedEnhancers">The supported enhancers.</param>
|
/// <param name="supportedEnhancers">The supported enhancers.</param>
|
||||||
/// <param name="cacheGuid">The cache unique identifier.</param>
|
/// <param name="cacheGuid">The cache unique identifier.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>Task<System.String>.</returns>
|
/// <returns>Task<System.String>.</returns>
|
||||||
/// <exception cref="ArgumentNullException">
|
/// <exception cref="ArgumentNullException">
|
||||||
/// originalImagePath
|
/// originalImagePath
|
||||||
|
@ -584,9 +560,9 @@ namespace Emby.Drawing
|
||||||
BaseItem item,
|
BaseItem item,
|
||||||
ImageType imageType,
|
ImageType imageType,
|
||||||
int imageIndex,
|
int imageIndex,
|
||||||
IImageEnhancer[] supportedEnhancers,
|
IReadOnlyCollection<IImageEnhancer> supportedEnhancers,
|
||||||
string cacheGuid,
|
string cacheGuid,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(originalImagePath))
|
if (string.IsNullOrEmpty(originalImagePath))
|
||||||
{
|
{
|
||||||
|
@ -680,6 +656,7 @@ namespace Emby.Drawing
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(path));
|
throw new ArgumentNullException(nameof(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(uniqueName))
|
if (string.IsNullOrEmpty(uniqueName))
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(uniqueName));
|
throw new ArgumentNullException(nameof(uniqueName));
|
||||||
|
@ -722,6 +699,7 @@ namespace Emby.Drawing
|
||||||
return Path.Combine(path, prefix, filename);
|
return Path.Combine(path, prefix, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public void CreateImageCollage(ImageCollageOptions options)
|
public void CreateImageCollage(ImageCollageOptions options)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Creating image collage and saving to {Path}", options.OutputPath);
|
_logger.LogInformation("Creating image collage and saving to {Path}", options.OutputPath);
|
||||||
|
@ -731,38 +709,25 @@ namespace Emby.Drawing
|
||||||
_logger.LogInformation("Completed creation of image collage and saved to {Path}", options.OutputPath);
|
_logger.LogInformation("Completed creation of image collage and saved to {Path}", options.OutputPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IImageEnhancer[] GetSupportedEnhancers(BaseItem item, ImageType imageType)
|
/// <inheritdoc />
|
||||||
|
public IEnumerable<IImageEnhancer> GetSupportedEnhancers(BaseItem item, ImageType imageType)
|
||||||
{
|
{
|
||||||
List<IImageEnhancer> list = null;
|
|
||||||
|
|
||||||
foreach (var i in ImageEnhancers)
|
foreach (var i in ImageEnhancers)
|
||||||
{
|
{
|
||||||
try
|
if (i.Supports(item, imageType))
|
||||||
{
|
{
|
||||||
if (i.Supports(item, imageType))
|
yield return i;
|
||||||
{
|
|
||||||
if (list == null)
|
|
||||||
{
|
|
||||||
list = new List<IImageEnhancer>();
|
|
||||||
}
|
|
||||||
list.Add(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Error in image enhancer: {0}", i.GetType().Name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return list == null ? Array.Empty<IImageEnhancer>() : list.ToArray();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dictionary<string, LockInfo> _locks = new Dictionary<string, LockInfo>();
|
|
||||||
private class LockInfo
|
private class LockInfo
|
||||||
{
|
{
|
||||||
public SemaphoreSlim Lock = new SemaphoreSlim(1, 1);
|
public SemaphoreSlim Lock = new SemaphoreSlim(1, 1);
|
||||||
public int Count = 1;
|
public int Count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private LockInfo GetLock(string key)
|
private LockInfo GetLock(string key)
|
||||||
{
|
{
|
||||||
lock (_locks)
|
lock (_locks)
|
||||||
|
@ -795,7 +760,7 @@ namespace Emby.Drawing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _disposed;
|
/// <inheritdoc />
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
_disposed = true;
|
_disposed = true;
|
||||||
|
|
|
@ -5,38 +5,42 @@ using MediaBrowser.Model.Drawing;
|
||||||
|
|
||||||
namespace Emby.Drawing
|
namespace Emby.Drawing
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A fallback implementation of <see cref="IImageEncoder" />.
|
||||||
|
/// </summary>
|
||||||
public class NullImageEncoder : IImageEncoder
|
public class NullImageEncoder : IImageEncoder
|
||||||
{
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
public IReadOnlyCollection<string> SupportedInputFormats
|
public IReadOnlyCollection<string> SupportedInputFormats
|
||||||
=> new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "png", "jpeg", "jpg" };
|
=> new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "png", "jpeg", "jpg" };
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public IReadOnlyCollection<ImageFormat> SupportedOutputFormats
|
public IReadOnlyCollection<ImageFormat> SupportedOutputFormats
|
||||||
=> new HashSet<ImageFormat>() { ImageFormat.Jpg, ImageFormat.Png };
|
=> new HashSet<ImageFormat>() { ImageFormat.Jpg, ImageFormat.Png };
|
||||||
|
|
||||||
public void CropWhiteSpace(string inputPath, string outputPath)
|
/// <inheritdoc />
|
||||||
{
|
public string Name => "Null Image Encoder";
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public bool SupportsImageCollageCreation => false;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public bool SupportsImageEncoding => false;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public ImageDimensions GetImageSize(string path)
|
||||||
|
=> throw new NotImplementedException();
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public string EncodeImage(string inputPath, DateTime dateModified, string outputPath, bool autoOrient, ImageOrientation? orientation, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat)
|
public string EncodeImage(string inputPath, DateTime dateModified, string outputPath, bool autoOrient, ImageOrientation? orientation, int quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public void CreateImageCollage(ImageCollageOptions options)
|
public void CreateImageCollage(ImageCollageOptions options)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name => "Null Image Encoder";
|
|
||||||
|
|
||||||
public bool SupportsImageCollageCreation => false;
|
|
||||||
|
|
||||||
public bool SupportsImageEncoding => false;
|
|
||||||
|
|
||||||
public ImageDimensions GetImageSize(string path)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -510,13 +510,8 @@ namespace Emby.Server.Implementations
|
||||||
return AllConcreteTypes.Where(i => currentType.IsAssignableFrom(i));
|
return AllConcreteTypes.Where(i => currentType.IsAssignableFrom(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc />
|
||||||
/// Gets the exports.
|
public IReadOnlyCollection<T> GetExports<T>(bool manageLifetime = true)
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T">The type</typeparam>
|
|
||||||
/// <param name="manageLifetime">if set to <c>true</c> [manage lifetime].</param>
|
|
||||||
/// <returns>IEnumerable{``0}.</returns>
|
|
||||||
public IEnumerable<T> GetExports<T>(bool manageLifetime = true)
|
|
||||||
{
|
{
|
||||||
var parts = GetExportTypes<T>()
|
var parts = GetExportTypes<T>()
|
||||||
.Select(CreateInstanceSafe)
|
.Select(CreateInstanceSafe)
|
||||||
|
@ -538,6 +533,7 @@ namespace Emby.Server.Implementations
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Runs the startup tasks.
|
/// Runs the startup tasks.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <returns><see cref="Task" />.</returns>
|
||||||
public async Task RunStartupTasksAsync()
|
public async Task RunStartupTasksAsync()
|
||||||
{
|
{
|
||||||
Logger.LogInformation("Running startup tasks");
|
Logger.LogInformation("Running startup tasks");
|
||||||
|
@ -550,7 +546,7 @@ namespace Emby.Server.Implementations
|
||||||
|
|
||||||
Logger.LogInformation("ServerId: {0}", SystemId);
|
Logger.LogInformation("ServerId: {0}", SystemId);
|
||||||
|
|
||||||
var entryPoints = GetExports<IServerEntryPoint>().ToList();
|
var entryPoints = GetExports<IServerEntryPoint>();
|
||||||
|
|
||||||
var stopWatch = new Stopwatch();
|
var stopWatch = new Stopwatch();
|
||||||
stopWatch.Start();
|
stopWatch.Start();
|
||||||
|
@ -801,7 +797,7 @@ namespace Emby.Server.Implementations
|
||||||
|
|
||||||
serviceCollection.AddSingleton(HttpServer);
|
serviceCollection.AddSingleton(HttpServer);
|
||||||
|
|
||||||
ImageProcessor = GetImageProcessor();
|
ImageProcessor = new ImageProcessor(LoggerFactory.CreateLogger<ImageProcessor>(), ServerConfigurationManager.ApplicationPaths, FileSystemManager, ImageEncoder, () => LibraryManager, () => MediaEncoder);
|
||||||
serviceCollection.AddSingleton(ImageProcessor);
|
serviceCollection.AddSingleton(ImageProcessor);
|
||||||
|
|
||||||
TVSeriesManager = new TVSeriesManager(UserManager, UserDataManager, LibraryManager, ServerConfigurationManager);
|
TVSeriesManager = new TVSeriesManager(UserManager, UserDataManager, LibraryManager, ServerConfigurationManager);
|
||||||
|
@ -953,11 +949,6 @@ namespace Emby.Server.Implementations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IImageProcessor GetImageProcessor()
|
|
||||||
{
|
|
||||||
return new ImageProcessor(LoggerFactory, ServerConfigurationManager.ApplicationPaths, FileSystemManager, ImageEncoder, () => LibraryManager, () => MediaEncoder);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the user repository.
|
/// Gets the user repository.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1087,7 +1078,7 @@ namespace Emby.Server.Implementations
|
||||||
GetExports<IMetadataSaver>(),
|
GetExports<IMetadataSaver>(),
|
||||||
GetExports<IExternalId>());
|
GetExports<IExternalId>());
|
||||||
|
|
||||||
ImageProcessor.AddParts(GetExports<IImageEnhancer>());
|
ImageProcessor.ImageEnhancers = GetExports<IImageEnhancer>();
|
||||||
|
|
||||||
LiveTvManager.AddParts(GetExports<ILiveTvService>(), GetExports<ITunerHost>(), GetExports<IListingsProvider>());
|
LiveTvManager.AddParts(GetExports<ILiveTvService>(), GetExports<ITunerHost>(), GetExports<IListingsProvider>());
|
||||||
|
|
||||||
|
|
|
@ -1364,7 +1364,7 @@ namespace Emby.Server.Implementations.Dto
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var supportedEnhancers = _imageProcessor.GetSupportedEnhancers(item, ImageType.Primary);
|
var supportedEnhancers = _imageProcessor.GetSupportedEnhancers(item, ImageType.Primary).ToArray();
|
||||||
|
|
||||||
ImageDimensions size;
|
ImageDimensions size;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -550,14 +550,14 @@ namespace MediaBrowser.Api.Images
|
||||||
}
|
}
|
||||||
|
|
||||||
IImageEnhancer[] supportedImageEnhancers;
|
IImageEnhancer[] supportedImageEnhancers;
|
||||||
if (_imageProcessor.ImageEnhancers.Length > 0)
|
if (_imageProcessor.ImageEnhancers.Count > 0)
|
||||||
{
|
{
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
item = _libraryManager.GetItemById(itemId);
|
item = _libraryManager.GetItemById(itemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
supportedImageEnhancers = request.EnableImageEnhancers ? _imageProcessor.GetSupportedEnhancers(item, request.Type) : Array.Empty<IImageEnhancer>();
|
supportedImageEnhancers = request.EnableImageEnhancers ? _imageProcessor.GetSupportedEnhancers(item, request.Type).ToArray() : Array.Empty<IImageEnhancer>();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -606,8 +606,8 @@ namespace MediaBrowser.Api.Images
|
||||||
ImageRequest request,
|
ImageRequest request,
|
||||||
ItemImageInfo image,
|
ItemImageInfo image,
|
||||||
bool cropwhitespace,
|
bool cropwhitespace,
|
||||||
ImageFormat[] supportedFormats,
|
IReadOnlyCollection<ImageFormat> supportedFormats,
|
||||||
IImageEnhancer[] enhancers,
|
IReadOnlyCollection<IImageEnhancer> enhancers,
|
||||||
TimeSpan? cacheDuration,
|
TimeSpan? cacheDuration,
|
||||||
IDictionary<string, string> headers,
|
IDictionary<string, string> headers,
|
||||||
bool isHeadRequest)
|
bool isHeadRequest)
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -75,10 +75,10 @@ namespace MediaBrowser.Common
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the exports.
|
/// Gets the exports.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T"></typeparam>
|
/// <typeparam name="T">The type.</typeparam>
|
||||||
/// <param name="manageLiftime">if set to <c>true</c> [manage liftime].</param>
|
/// <param name="manageLifetime">If set to <c>true</c> [manage lifetime].</param>
|
||||||
/// <returns>IEnumerable{``0}.</returns>
|
/// <returns><see cref="IReadOnlyCollection{T}" />.</returns>
|
||||||
IEnumerable<T> GetExports<T>(bool manageLifetime = true);
|
IReadOnlyCollection<T> GetExports<T>(bool manageLifetime = true);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resolves this instance.
|
/// Resolves this instance.
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -17,16 +17,6 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
/// <value>The supported output formats.</value>
|
/// <value>The supported output formats.</value>
|
||||||
IReadOnlyCollection<ImageFormat> SupportedOutputFormats { get; }
|
IReadOnlyCollection<ImageFormat> SupportedOutputFormats { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Encodes the image.
|
|
||||||
/// </summary>
|
|
||||||
string EncodeImage(string inputPath, DateTime dateModified, string outputPath, bool autoOrient, ImageOrientation? orientation, int quality, ImageProcessingOptions options, ImageFormat outputFormat);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates the image collage.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="options">The options.</param>
|
|
||||||
void CreateImageCollage(ImageCollageOptions options);
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the name.
|
/// Gets the name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -46,5 +36,16 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
bool SupportsImageEncoding { get; }
|
bool SupportsImageEncoding { get; }
|
||||||
|
|
||||||
ImageDimensions GetImageSize(string path);
|
ImageDimensions GetImageSize(string path);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Encodes the image.
|
||||||
|
/// </summary>
|
||||||
|
string EncodeImage(string inputPath, DateTime dateModified, string outputPath, bool autoOrient, ImageOrientation? orientation, int quality, ImageProcessingOptions options, ImageFormat outputFormat);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates the image collage.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="options">The options.</param>
|
||||||
|
void CreateImageCollage(ImageCollageOptions options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,15 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
/// Gets the image enhancers.
|
/// Gets the image enhancers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The image enhancers.</value>
|
/// <value>The image enhancers.</value>
|
||||||
IImageEnhancer[] ImageEnhancers { get; }
|
IReadOnlyCollection<IImageEnhancer> ImageEnhancers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether [supports image collage creation].
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if [supports image collage creation]; otherwise, <c>false</c>.</value>
|
||||||
|
bool SupportsImageCollageCreation { get; }
|
||||||
|
|
||||||
|
IImageEncoder ImageEncoder { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the dimensions of the image.
|
/// Gets the dimensions of the image.
|
||||||
|
@ -50,19 +58,13 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
/// <returns>ImageDimensions</returns>
|
/// <returns>ImageDimensions</returns>
|
||||||
ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info, bool updateItem);
|
ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info, bool updateItem);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds the parts.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="enhancers">The enhancers.</param>
|
|
||||||
void AddParts(IEnumerable<IImageEnhancer> enhancers);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the supported enhancers.
|
/// Gets the supported enhancers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <param name="imageType">Type of the image.</param>
|
/// <param name="imageType">Type of the image.</param>
|
||||||
/// <returns>IEnumerable{IImageEnhancer}.</returns>
|
/// <returns>IEnumerable{IImageEnhancer}.</returns>
|
||||||
IImageEnhancer[] GetSupportedEnhancers(BaseItem item, ImageType imageType);
|
IEnumerable<IImageEnhancer> GetSupportedEnhancers(BaseItem item, ImageType imageType);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the image cache tag.
|
/// Gets the image cache tag.
|
||||||
|
@ -80,7 +82,7 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
/// <param name="image">The image.</param>
|
/// <param name="image">The image.</param>
|
||||||
/// <param name="imageEnhancers">The image enhancers.</param>
|
/// <param name="imageEnhancers">The image enhancers.</param>
|
||||||
/// <returns>Guid.</returns>
|
/// <returns>Guid.</returns>
|
||||||
string GetImageCacheTag(BaseItem item, ItemImageInfo image, IImageEnhancer[] imageEnhancers);
|
string GetImageCacheTag(BaseItem item, ItemImageInfo image, IReadOnlyCollection<IImageEnhancer> imageEnhancers);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes the image.
|
/// Processes the image.
|
||||||
|
@ -109,7 +111,7 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the supported image output formats.
|
/// Gets the supported image output formats.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>IReadOnlyCollection{ImageOutput}.</returns>
|
/// <returns><see cref="IReadOnlyCollection{ImageOutput}" />.</returns>
|
||||||
IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats();
|
IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -118,14 +120,6 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
/// <param name="options">The options.</param>
|
/// <param name="options">The options.</param>
|
||||||
void CreateImageCollage(ImageCollageOptions options);
|
void CreateImageCollage(ImageCollageOptions options);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a value indicating whether [supports image collage creation].
|
|
||||||
/// </summary>
|
|
||||||
/// <value><c>true</c> if [supports image collage creation]; otherwise, <c>false</c>.</value>
|
|
||||||
bool SupportsImageCollageCreation { get; }
|
|
||||||
|
|
||||||
IImageEncoder ImageEncoder { get; set; }
|
|
||||||
|
|
||||||
bool SupportsTransparency(string path);
|
bool SupportsTransparency(string path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
|
@ -33,9 +34,9 @@ namespace MediaBrowser.Controller.Drawing
|
||||||
|
|
||||||
public int Quality { get; set; }
|
public int Quality { get; set; }
|
||||||
|
|
||||||
public IImageEnhancer[] Enhancers { get; set; }
|
public IReadOnlyCollection<IImageEnhancer> Enhancers { get; set; }
|
||||||
|
|
||||||
public ImageFormat[] SupportedOutputFormats { get; set; }
|
public IReadOnlyCollection<ImageFormat> SupportedOutputFormats { get; set; }
|
||||||
|
|
||||||
public bool AddPlayedIndicator { get; set; }
|
public bool AddPlayedIndicator { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in New Issue