Browse Source

made AutoOrientExtensions non-generic

af/merge-core
Anton Firszov 7 years ago
parent
commit
139a0000ce
  1. 10
      src/ImageSharp/Processing/AutoOrientExtensions.cs
  2. 2
      tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs

10
src/ImageSharp/Processing/AutoOrientExtensions.cs

@ -7,7 +7,7 @@ using SixLabors.ImageSharp.Processing.Processors.Transforms;
namespace SixLabors.ImageSharp.Processing
{
/// <summary>
/// Defines extensions that allow the application of auto-orientation operations to an <see cref="Image{TPixel}"/>
/// Defines extensions that allow the application of auto-orientation operations to an <see cref="Image"/>
/// using Mutate/Clone.
/// </summary>
public static class AutoOrientExtensions
@ -15,11 +15,9 @@ namespace SixLabors.ImageSharp.Processing
/// <summary>
/// Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image.
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image to auto rotate.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessingContext<TPixel> AutoOrient<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new AutoOrientProcessor<TPixel>());
/// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns>
public static IImageProcessingContext AutoOrient(this IImageProcessingContext source)
=> source.ApplyProcessor(new AutoOrientProcessor());
}
}

2
tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs

@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms
public void AutoOrient_AutoOrientProcessor()
{
this.operations.AutoOrient();
this.Verify<AutoOrientProcessor<Rgba32>>();
this.Verify<AutoOrientProcessor>();
}
}
}
Loading…
Cancel
Save