Browse Source

Cleanup

Former-commit-id: 13d6072a5070024926e14e2508f88fb93306587e
Former-commit-id: 3b66d353393a27e50840e3aea98efa3b4259ad95
af/merge-core
James South 11 years ago
parent
commit
34ed705dc6
  1. 5
      src/ImageProcessor.Web/Helpers/ImageHelpers.cs
  2. 40
      src/ImageProcessor/ImageFactory.cs

5
src/ImageProcessor.Web/Helpers/ImageHelpers.cs

@ -29,11 +29,6 @@ namespace ImageProcessor.Web.Helpers
/// </summary>
public static readonly string ExtensionRegexPattern = BuildExtensionRegexPattern();
/// <summary>
/// The regex for matching the format to ignore when parsing image extensions.
/// </summary>
private static readonly Regex FormatProcessorRegex = new Regex(@"format=[\w+-]+.", RegexOptions.IgnoreCase);
/// <summary>
/// The image format regex.
/// </summary>

40
src/ImageProcessor/ImageFactory.cs

@ -299,26 +299,6 @@ namespace ImageProcessor
return this;
}
/// <summary>
/// Crops an image to the area of greatest entropy.
/// </summary>
/// <param name="threshold">
/// The threshold in bytes to control the entropy.
/// </param>
/// <returns>
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public ImageFactory EntropyCrop(byte threshold = 128)
{
if (this.ShouldProcess)
{
EntropyCrop autoCrop = new EntropyCrop { DynamicParameter = threshold };
this.CurrentImageFormat.ApplyProcessor(autoCrop.ProcessImage, this);
}
return this;
}
/// <summary>
/// Performs auto-rotation to ensure that EXIF defined rotation is reflected in
/// the final image.
@ -495,6 +475,26 @@ namespace ImageProcessor
return this;
}
/// <summary>
/// Crops an image to the area of greatest entropy.
/// </summary>
/// <param name="threshold">
/// The threshold in bytes to control the entropy.
/// </param>
/// <returns>
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public ImageFactory EntropyCrop(byte threshold = 128)
{
if (this.ShouldProcess)
{
EntropyCrop autoCrop = new EntropyCrop { DynamicParameter = threshold };
this.CurrentImageFormat.ApplyProcessor(autoCrop.ProcessImage, this);
}
return this;
}
/// <summary>
/// Applies a filter to the current image. Use the <see cref="MatrixFilters"/> class to
/// assign the correct filter.

Loading…
Cancel
Save