Commit 87a1916e authored by Alessio Parma's avatar Alessio Parma

fixes

parent 47b91088
......@@ -51,7 +51,7 @@ public interface IThumbnailerClient
/// <param name="shavePx">Shaves <paramref name="shavePx"/> from source file edges.</param>
/// <param name="fill">
/// If true, a trasparent background will be added so that thumbnail width and height are
/// exactly as requested, preserving source file aspect ratio.
/// exactly as requested, preserving source file aspect ratio. Defaults to true.
/// </param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>A thumbnail of given source file.</returns>
......@@ -60,7 +60,7 @@ public interface IThumbnailerClient
ushort widthPx = Validator.ThumbnailSidePx,
ushort heightPx = Validator.ThumbnailSidePx,
ushort shavePx = Validator.ThumbnailShavePx,
bool fill = default,
bool fill = true,
CancellationToken cancellationToken = default);
/// <summary>
......@@ -82,7 +82,7 @@ public interface IThumbnailerClient
/// <param name="shavePx">Shaves <paramref name="shavePx"/> from source file edges.</param>
/// <param name="fill">
/// If true, a trasparent background will be added so that thumbnail width and height are
/// exactly as requested, preserving source file aspect ratio.
/// exactly as requested, preserving source file aspect ratio. Defaults to true.
/// </param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>A thumbnail of given source file.</returns>
......@@ -92,7 +92,7 @@ public interface IThumbnailerClient
ushort widthPx = Validator.ThumbnailSidePx,
ushort heightPx = Validator.ThumbnailSidePx,
ushort shavePx = Validator.ThumbnailShavePx,
bool fill = default,
bool fill = true,
CancellationToken cancellationToken = default);
/// <summary>
......
......@@ -62,11 +62,9 @@ public sealed class ConcreteThumbnailerClient : IThumbnailerClient
/// <inheritdoc/>
public async Task<byte[]> GetThumbnailAsync(
Uri fileUri,
ushort widthPx = Validator.ThumbnailSidePx,
ushort heightPx = Validator.ThumbnailSidePx,
ushort shavePx = Validator.ThumbnailShavePx,
bool fill = default,
CancellationToken cancellationToken = default)
ushort widthPx, ushort heightPx,
ushort shavePx, bool fill,
CancellationToken cancellationToken)
{
_validator.ValidateFileUri(fileUri);
......@@ -86,12 +84,10 @@ public sealed class ConcreteThumbnailerClient : IThumbnailerClient
/// <inheritdoc/>
public async Task<byte[]> GetThumbnailAsync(
byte[] contents, string contentType,
string? fileName = default,
ushort widthPx = Validator.ThumbnailSidePx,
ushort heightPx = Validator.ThumbnailSidePx,
ushort shavePx = Validator.ThumbnailShavePx,
bool fill = default,
CancellationToken cancellationToken = default)
string? fileName,
ushort widthPx, ushort heightPx,
ushort shavePx, bool fill,
CancellationToken cancellationToken)
{
_validator.ValidateFileBytes(contents);
_validator.ValidateContentTypeForThumbnailGeneration(contentType, @throw: true);
......@@ -126,8 +122,8 @@ public Task<bool> IsThumbnailGenerationSupportedAsync(string contentType)
/// <inheritdoc/>
public async Task<byte[]> OptimizeImageAsync(
Uri fileUri,
OptimizationMode mode = default,
CancellationToken cancellationToken = default)
OptimizationMode mode,
CancellationToken cancellationToken)
{
_validator.ValidateFileUri(fileUri);
......@@ -144,9 +140,9 @@ public Task<bool> IsThumbnailGenerationSupportedAsync(string contentType)
/// <inheritdoc/>
public async Task<byte[]> OptimizeImageAsync(
byte[] contents, string contentType,
string? fileName = default,
OptimizationMode mode = default,
CancellationToken cancellationToken = default)
string? fileName,
OptimizationMode mode,
CancellationToken cancellationToken)
{
_validator.ValidateFileBytes(contents);
_validator.ValidateContentTypeForImageOptimization(contentType, @throw: true);
......
......@@ -55,7 +55,7 @@ public sealed class ConcreteOptimizationManager : IOptimizationManager
private static readonly IDictionary<string, string> s_lossyPlugins = new Dictionary<string, string>
{
// Docs: https://github.com/jihchi/imagemin-giflossy
[MimeTypeMap.IMAGE.GIF] = "--plugin=giflossy.interlaced=false",
[MimeTypeMap.IMAGE.GIF] = "--plugin.giflossy.interlaced=false",
// Docs: https://github.com/imagemin/imagemin-mozjpeg
[MimeTypeMap.IMAGE.JPEG] = "--plugin.mozjpeg.progressive=false",
// Docs: https://github.com/imagemin/imagemin-pngquant
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment