Browse Source

v 2.2.3

Added Rounded Corners method and fixed response type for formatted
images.


Former-commit-id: 1e21880106cd709ee5e4eaf5a1f5a3226d491c35
af/merge-core
JimBobSquarePants 13 years ago
parent
commit
b03ee905f0
  1. 2
      src/ImageProcessor.Web/HttpModules/ImageProcessingModule.cs
  2. 4
      src/ImageProcessor.Web/Properties/AssemblyInfo.cs
  3. 40
      src/ImageProcessor/ImageFactory.cs
  4. 2
      src/ImageProcessor/ImageProcessor.csproj
  5. 37
      src/ImageProcessor/Imaging/ImageUtils.cs
  6. 58
      src/ImageProcessor/Imaging/RotateLayer.cs
  7. 165
      src/ImageProcessor/Imaging/RoundedCornerLayer.cs
  8. 2
      src/ImageProcessor/Processors/Format.cs
  9. 350
      src/ImageProcessor/Processors/RoundedCorners.cs
  10. 4
      src/ImageProcessor/Properties/AssemblyInfo.cs
  11. BIN
      src/Nuget/ImageProcessor.1.6.0.0.nupkg
  12. 1
      src/Nuget/ImageProcessor.Web.2.2.3.0.nupkg.REMOVED.git-id

2
src/ImageProcessor.Web/HttpModules/ImageProcessingModule.cs

@ -231,7 +231,7 @@ namespace ImageProcessor.Web.HttpModules
}
// Store the response type in the context for later retrieval.
context.Items[CachedResponseTypeKey] = ImageUtils.GetResponseType(imageName).ToDescription();
context.Items[CachedResponseTypeKey] = ImageUtils.GetResponseType(fullPath).ToDescription();
// The cached file is valid so just rewrite the path.
context.RewritePath(cache.GetVirtualCachedPath(), false);

4
src/ImageProcessor.Web/Properties/AssemblyInfo.cs

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.2.2.0")]
[assembly: AssemblyFileVersion("2.2.2.0")]
[assembly: AssemblyVersion("2.2.3.0")]
[assembly: AssemblyFileVersion("2.2.3.0")]

40
src/ImageProcessor/ImageFactory.cs

@ -92,14 +92,14 @@ namespace ImageProcessor
public bool ShouldProcess { get; private set; }
/// <summary>
/// Gets or sets the quality of output for jpeg images as a percentile.
/// Gets the file format of the image.
/// </summary>
internal int JpegQuality { get; set; }
public ImageFormat ImageFormat { get; private set; }
/// <summary>
/// Gets or sets the file format of the image.
/// Gets or sets the quality of output for jpeg images as a percentile.
/// </summary>
internal ImageFormat ImageFormat { get; set; }
internal int JpegQuality { get; set; }
#endregion
#region Methods
@ -472,6 +472,32 @@ namespace ImageProcessor
return this;
}
/// <summary>
/// Adds rounded corners to the current image.
/// </summary>
/// <param name="roundedCornerLayer">
/// The <see cref="T:ImageProcessor.Imaging.RoundedCornerLayer"/> containing the properties to round corners on the image.
/// </param>
/// <returns>
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public ImageFactory RoundedCorners(RoundedCornerLayer roundedCornerLayer)
{
if (this.ShouldProcess)
{
if (roundedCornerLayer.Radius < 0)
{
roundedCornerLayer.Radius = 0;
}
RoundedCorners roundedCorners = new RoundedCorners { DynamicParameter = roundedCornerLayer };
this.Image = roundedCorners.ProcessImage(this);
}
return this;
}
/// <summary>
/// Changes the saturation of the current image.
/// </summary>
@ -561,7 +587,7 @@ namespace ImageProcessor
// Fix the colour palette of gif images.
this.FixGifs();
if (object.Equals(this.ImageFormat, ImageFormat.Jpeg))
if (this.ImageFormat.Equals(ImageFormat.Jpeg))
{
// Jpegs can be saved with different settings to include a quality setting for the JPEG compression.
// This improves output compression and quality.
@ -601,7 +627,7 @@ namespace ImageProcessor
// Fix the colour palette of gif images.
this.FixGifs();
if (object.Equals(this.ImageFormat, ImageFormat.Jpeg))
if (this.ImageFormat.Equals(ImageFormat.Jpeg))
{
// Jpegs can be saved with different settings to include a quality setting for the JPEG compression.
// This improves output compression and quality.
@ -658,7 +684,7 @@ namespace ImageProcessor
// Dispose of any managed resources here.
if (this.Image != null)
{
// Dispose of the memorystream from Load and the image.
// Dispose of the memory stream from Load and the image.
if (this.Image.Tag != null)
{
((IDisposable)this.Image.Tag).Dispose();

2
src/ImageProcessor/ImageProcessor.csproj

@ -78,10 +78,12 @@
<Compile Include="Imaging\Quantizer.cs" />
<Compile Include="Imaging\ResponseType.cs" />
<Compile Include="Imaging\RotateLayer.cs" />
<Compile Include="Imaging\RoundedCornerLayer.cs" />
<Compile Include="Imaging\TextLayer.cs" />
<Compile Include="Processors\Alpha.cs" />
<Compile Include="Processors\Brightness.cs" />
<Compile Include="Processors\Contrast.cs" />
<Compile Include="Processors\RoundedCorners.cs" />
<Compile Include="Processors\Saturate.cs" />
<Compile Include="Processors\Flip.cs" />
<Compile Include="Processors\Rotate.cs" />

37
src/ImageProcessor/Imaging/ImageUtils.cs

@ -12,6 +12,7 @@ namespace ImageProcessor.Imaging
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
#endregion
@ -21,32 +22,36 @@ namespace ImageProcessor.Imaging
public static class ImageUtils
{
/// <summary>
/// Returns the correct response type based on the given file extension.
/// The image format regex.
/// </summary>
/// <param name="fileName">The string containing the filename to check against.</param>
/// <returns>The correct response type based on the given file extension.</returns>
public static ResponseType GetResponseType(string fileName)
private static readonly Regex FormatRegex = new Regex(@"j(pg|peg)|bmp|png|gif", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.RightToLeft);
/// <summary>
/// Returns the correct response type based on the given request path.
/// </summary>
/// <param name="request">
/// The request to match.
/// </param>
/// <returns>
/// The correct <see cref="ResponseType"/>.
/// </returns>
public static ResponseType GetResponseType(string request)
{
string extension = Path.GetExtension(fileName);
if (extension != null)
foreach (Match match in FormatRegex.Matches(request))
{
string ext = extension.ToUpperInvariant();
switch (ext)
switch (match.Value)
{
case ".PNG":
case "png":
return ResponseType.Png;
case ".BMP":
case "bmp":
return ResponseType.Bmp;
case ".GIF":
case "gif":
return ResponseType.Gif;
default:
// Should be a jpeg.
return ResponseType.Jpeg;
}
}
// TODO: Should we call this on bad request?
return ResponseType.Jpeg;
}
@ -143,10 +148,10 @@ namespace ImageProcessor.Imaging
}
/// <summary>
/// Returns an instance of EncodingParameters for jpeg comression.
/// Returns an instance of EncodingParameters for jpeg compression.
/// </summary>
/// <param name="quality">The quality to return the image at.</param>
/// <returns>The encodingParameters for jpeg comression. </returns>
/// <returns>The encodingParameters for jpeg compression. </returns>
public static EncoderParameters GetEncodingParameters(int quality)
{
EncoderParameters encoderParameters = null;

58
src/ImageProcessor/Imaging/RotateLayer.cs

@ -8,15 +8,13 @@
namespace ImageProcessor.Imaging
{
#region Using
using System;
using System.Collections.Generic;
using System.Drawing;
#endregion
/// <summary>
/// Encapsulates the properties required to rotate an image.
/// </summary>
public class RotateLayer : IEqualityComparer<RotateLayer>
public class RotateLayer
{
#region Constructors
/// <summary>
@ -69,55 +67,37 @@ namespace ImageProcessor.Imaging
#endregion
/// <summary>
/// Returns a value indicating whether this instance is equal to another <see cref="ImageProcessor.Imaging.RotateLayer"/>.
/// Returns a value that indicates whether the specified object is an
/// <see cref="RotateLayer"/> object that is equivalent to
/// this <see cref="RotateLayer"/> object.
/// </summary>
/// <param name="other">
/// The other <see cref="ImageProcessor.Imaging.RotateLayer"/> to compare to.
/// <param name="obj">
/// The object to test.
/// </param>
/// <returns>
/// True if this instance is equal to another <see cref="ImageProcessor.Imaging.RotateLayer"/>; otherwise, false.
/// True if the given object is an <see cref="RotateLayer"/> object that is equivalent to
/// this <see cref="RotateLayer"/> object; otherwise, false.
/// </returns>
public bool Equals(RotateLayer other)
public override bool Equals(object obj)
{
return this.Angle.Equals(other.Angle) && this.BackgroundColor.Equals(other.BackgroundColor);
}
RotateLayer rotate = obj as RotateLayer;
/// <summary>
/// Determines whether the specified objects are equal.
/// </summary>
/// <returns>
/// true if the specified objects are equal; otherwise, false.
/// </returns>
/// <param name="x">
/// The first object of type <see cref="ImageProcessor.Imaging.RotateLayer"/> to compare.
/// </param>
/// <param name="y">
/// The second object of type <see cref="ImageProcessor.Imaging.RotateLayer"/> to compare.
/// </param>
public bool Equals(RotateLayer x, RotateLayer y)
{
return x.Angle.Equals(y.Angle) && x.BackgroundColor.Equals(y.BackgroundColor);
if (rotate == null)
{
return false;
}
return this.Angle == rotate.Angle && this.BackgroundColor == rotate.BackgroundColor;
}
/// <summary>
/// Returns a hash code for the specified object.
/// Returns a hash code value that represents this object.
/// </summary>
/// <returns>
/// A hash code for the specified object.
/// A hash code that represents this object.
/// </returns>
/// <param name="obj">
/// The <see cref="T:System.Object"/> for which a hash code is to be returned.
/// </param>
/// <exception cref="T:System.ArgumentNullException">
/// The type of <paramref name="obj"/> is a reference type and <paramref name="obj"/> is null.
/// </exception>
public int GetHashCode(RotateLayer obj)
public override int GetHashCode()
{
if (obj == null)
{
throw new ArgumentNullException();
}
return this.Angle.GetHashCode() + this.BackgroundColor.GetHashCode();
}
}

165
src/ImageProcessor/Imaging/RoundedCornerLayer.cs

@ -0,0 +1,165 @@
// -----------------------------------------------------------------------
// <copyright file="RoundedCornerLayer.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
namespace ImageProcessor.Imaging
{
#region Using
using System.Drawing;
#endregion
/// <summary>
/// Encapsulates the properties required to add rounded corners to an image.
/// </summary>
public class RoundedCornerLayer
{
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="RoundedCornerLayer"/> class.
/// </summary>
public RoundedCornerLayer()
{
this.Radius = 10;
this.BackgroundColor = Color.Transparent;
this.TopLeft = true;
this.TopRight = true;
this.BottomLeft = true;
this.BottomRight = true;
}
/// <summary>
/// Initializes a new instance of the <see cref="RoundedCornerLayer"/> class.
/// </summary>
/// <param name="radius">
/// The radius at which the corner will be done.
/// </param>
/// <param name="topLeft">
/// Set if top left is rounded
/// </param>
/// <param name="topRight">
/// Set if top right is rounded
/// </param>
/// <param name="bottomLeft">
/// Set if bottom left is rounded
/// </param>
/// <param name="bottomRight">
/// Set if bottom right is rounded
/// </param>
public RoundedCornerLayer(int radius, bool topLeft, bool topRight, bool bottomLeft, bool bottomRight)
{
this.Radius = radius;
this.BackgroundColor = Color.Transparent;
this.TopLeft = topLeft;
this.TopRight = topRight;
this.BottomLeft = bottomLeft;
this.BottomRight = bottomRight;
}
/// <summary>
/// Initializes a new instance of the <see cref="RoundedCornerLayer"/> class.
/// </summary>
/// <param name="radius">
/// The radius at which the corner will be done.
/// </param>
/// <param name="backgroundColor">
/// The <see cref="T:System.Drawing.Color"/> to set as the background color.
/// <remarks>Used for image formats that do not support transparency</remarks>
/// </param>
/// <param name="topLeft">
/// Set if top left is rounded
/// </param>
/// <param name="topRight">
/// Set if top right is rounded
/// </param>
/// <param name="bottomLeft">
/// Set if bottom left is rounded
/// </param>
/// <param name="bottomRight">
/// Set if bottom right is rounded
/// </param>
public RoundedCornerLayer(int radius, Color backgroundColor, bool topLeft, bool topRight, bool bottomLeft, bool bottomRight)
{
this.Radius = radius;
this.BackgroundColor = backgroundColor;
this.TopLeft = topLeft;
this.TopRight = topRight;
this.BottomLeft = bottomLeft;
this.BottomRight = bottomRight;
}
#endregion
#region Properties
/// <summary>
/// Gets or sets the radius of the corners.
/// </summary>
public int Radius { get; set; }
/// <summary>
/// Gets or sets the background color.
/// </summary>
public Color BackgroundColor { get; set; }
/// <summary>
/// Gets or sets a value indicating whether top left corners are to be added.
/// </summary>
public bool TopLeft { get; set; }
/// <summary>
/// Gets or sets a value indicating whether top right corners are to be added.
/// </summary>
public bool TopRight { get; set; }
/// <summary>
/// Gets or sets a value indicating whether bottom left corners are to be added.
/// </summary>
public bool BottomLeft { get; set; }
/// <summary>
/// Gets or sets a value indicating whether bottom right corners are to be added.
/// </summary>
public bool BottomRight { get; set; }
#endregion
/// <summary>
/// Returns a value that indicates whether the specified object is an
/// <see cref="RoundedCornerLayer"/> object that is equivalent to
/// this <see cref="RoundedCornerLayer"/> object.
/// </summary>
/// <param name="obj">
/// The object to test.
/// </param>
/// <returns>
/// True if the given object is an <see cref="RoundedCornerLayer"/> object that is equivalent to
/// this <see cref="RoundedCornerLayer"/> object; otherwise, false.
/// </returns>
public override bool Equals(object obj)
{
RoundedCornerLayer rounded = obj as RoundedCornerLayer;
if (rounded == null)
{
return false;
}
return this.Radius == rounded.Radius && this.BackgroundColor == rounded.BackgroundColor
&& this.TopLeft == rounded.TopLeft && this.TopRight == rounded.TopRight
&& this.BottomLeft == rounded.BottomLeft && this.BottomRight == rounded.BottomRight;
}
/// <summary>
/// Returns a hash code value that represents this object.
/// </summary>
/// <returns>
/// A hash code that represents this object.
/// </returns>
public override int GetHashCode()
{
return this.Radius.GetHashCode() + this.BackgroundColor.GetHashCode() +
this.TopLeft.GetHashCode() + this.TopRight.GetHashCode() +
this.BottomLeft.GetHashCode() + this.BottomRight.GetHashCode();
}
}
}

2
src/ImageProcessor/Processors/Format.cs

@ -129,7 +129,7 @@ namespace ImageProcessor.Processors
}
// Set the internal property.
factory.ImageFormat = imageFormat;
factory.Format(imageFormat);
return factory.Image;
}

350
src/ImageProcessor/Processors/RoundedCorners.cs

@ -0,0 +1,350 @@
// -----------------------------------------------------------------------
// <copyright file="RoundedCorners.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
namespace ImageProcessor.Processors
{
#region Using
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text.RegularExpressions;
using ImageProcessor.Imaging;
#endregion
/// <summary>
/// Encapsulates methods to add rounded corners to an image.
/// </summary>
public class RoundedCorners : IGraphicsProcessor
{
/// <summary>
/// The regular expression to search strings for.
/// </summary>
private static readonly Regex QueryRegex = new Regex(@"roundedcorners=(\d+|[^&]*)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the angle attribute.
/// </summary>
private static readonly Regex RadiusRegex = new Regex(@"radius-(\d+)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the color attribute.
/// </summary>
private static readonly Regex ColorRegex = new Regex(@"bgcolor-([0-9a-fA-F]{3}){1,2}", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the top left attribute.
/// </summary>
private static readonly Regex TopLeftRegex = new Regex(@"tl-(true|false)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the top right attribute.
/// </summary>
private static readonly Regex TopRightRegex = new Regex(@"tr-(true|false)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the bottom left attribute.
/// </summary>
private static readonly Regex BottomLeftRegex = new Regex(@"bl-(true|false)", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the bottom right attribute.
/// </summary>
private static readonly Regex BottomRightRegex = new Regex(@"br-(true|false)", RegexOptions.Compiled);
#region IGraphicsProcessor Members
/// <summary>
/// Gets the regular expression to search strings for.
/// </summary>
public Regex RegexPattern
{
get
{
return QueryRegex;
}
}
/// <summary>
/// Gets or sets DynamicParameter.
/// </summary>
public dynamic DynamicParameter
{
get;
set;
}
/// <summary>
/// Gets the order in which this processor is to be used in a chain.
/// </summary>
public int SortOrder
{
get;
private set;
}
/// <summary>
/// Gets or sets any additional settings required by the processor.
/// </summary>
public Dictionary<string, string> Settings
{
get;
set;
}
/// <summary>
/// The position in the original string where the first character of the captured substring was found.
/// </summary>
/// <param name="queryString">
/// The query string to search.
/// </param>
/// <returns>
/// The zero-based starting position in the original string where the captured substring was found.
/// </returns>
public int MatchRegexIndex(string queryString)
{
int index = 0;
// Set the sort order to max to allow filtering.
this.SortOrder = int.MaxValue;
foreach (Match match in this.RegexPattern.Matches(queryString))
{
if (match.Success)
{
if (index == 0)
{
// Set the index on the first instance only.
this.SortOrder = match.Index;
RoundedCornerLayer roundedCornerLayer;
string toParse = match.Value;
if (toParse.Contains("bgcolor"))
{
roundedCornerLayer = new RoundedCornerLayer(this.ParseRadius(toParse), this.ParseColor(toParse), this.ParseCorner(TopLeftRegex, toParse), this.ParseCorner(TopRightRegex, toParse), this.ParseCorner(BottomLeftRegex, toParse), this.ParseCorner(BottomRightRegex, toParse));
}
else
{
int radius;
int.TryParse(match.Value.Split('=')[1], out radius);
roundedCornerLayer = new RoundedCornerLayer(radius, this.ParseCorner(TopLeftRegex, toParse), this.ParseCorner(TopRightRegex, toParse), this.ParseCorner(BottomLeftRegex, toParse), this.ParseCorner(BottomRightRegex, toParse));
}
this.DynamicParameter = roundedCornerLayer;
}
index += 1;
}
}
return this.SortOrder;
}
/// <summary>
/// Processes the image.
/// </summary>
/// <param name="factory">
/// The the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class containing
/// the image to process.
/// </param>
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public Image ProcessImage(ImageFactory factory)
{
Bitmap newImage = null;
Image image = factory.Image;
try
{
RoundedCornerLayer roundedCornerLayer = this.DynamicParameter;
int radius = roundedCornerLayer.Radius;
Color backgroundColor = roundedCornerLayer.BackgroundColor;
bool topLeft = roundedCornerLayer.TopLeft;
bool topRight = roundedCornerLayer.TopRight;
bool bottomLeft = roundedCornerLayer.BottomLeft;
bool bottomRight = roundedCornerLayer.BottomRight;
// Create a rotated image.
newImage = this.RoundCornerImage(image, radius, backgroundColor, topLeft, topRight, bottomLeft, bottomRight);
newImage.Tag = image.Tag;
image.Dispose();
image = newImage;
}
catch
{
if (newImage != null)
{
newImage.Dispose();
}
}
return image;
}
#endregion
#region Private Methods
/// <summary>
/// Adds rounded corners to the image
/// </summary>
/// <param name="image">The image to add corners too</param>
/// <param name="cornerRadius">The radius of the corners.</param>
/// <param name="backgroundColor">The background color to fill an image with.</param>
/// <param name="topLeft">If the top left corner will have a rounded corner?</param>
/// <param name="topRight">If the top right corner will have a rounded corner?</param>
/// <param name="bottomLeft">If the bottom left corner will have a rounded corner?</param>
/// <param name="bottomRight">If the bottom right corner will have a rounded corner?</param>
/// <returns>The image with rounded corners.</returns>
private Bitmap RoundCornerImage(Image image, int cornerRadius, Color backgroundColor, bool topLeft = false, bool topRight = false, bool bottomLeft = false, bool bottomRight = false)
{
int width = image.Width;
int height = image.Height;
// Create a new empty bitmap to hold rotated image
Bitmap newImage = new Bitmap(image.Width, image.Height);
newImage.SetResolution(image.HorizontalResolution, image.VerticalResolution);
// Make a graphics object from the empty bitmap
using (Graphics graphics = Graphics.FromImage(newImage))
{
// Reduce the jagged edge.
graphics.SmoothingMode = SmoothingMode.HighQuality;
// Contrary to everything I have read bicubic is producing the best results.
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
graphics.CompositingQuality = CompositingQuality.HighSpeed;
// Fill the background.
graphics.Clear(backgroundColor);
// Add rounded corners
using (GraphicsPath path = new GraphicsPath())
{
// Determined if the top left has a rounded corner
if (topLeft)
{
path.AddArc(0, 0, cornerRadius, cornerRadius, 180, 90);
}
else
{
path.AddLine(0, 0, 0, 0);
}
// Determined if the top right has a rounded corner
if (topRight)
{
path.AddArc(0 + width - cornerRadius, 0, cornerRadius, cornerRadius, 270, 90);
}
else
{
path.AddLine(width, 0, width, 0);
}
// Determined if the bottom left has a rounded corner
if (bottomRight)
{
path.AddArc(0 + width - cornerRadius, 0 + height - cornerRadius, cornerRadius, cornerRadius, 0, 90);
}
else
{
path.AddLine(width, height, width, height);
}
// Determined if the bottom right has a rounded corner
if (bottomLeft)
{
path.AddArc(0, 0 + height - cornerRadius, cornerRadius, cornerRadius, 90, 90);
}
else
{
path.AddLine(0, height, 0, height);
}
using (Brush brush = new TextureBrush(image))
{
graphics.FillPath(brush, path);
}
}
}
return newImage;
}
/// <summary>
/// Returns the correct <see cref="T:System.Int32"/> containing the radius for the given string.
/// </summary>
/// <param name="input">
/// The input string containing the value to parse.
/// </param>
/// <returns>
/// The correct <see cref="T:System.Int32"/> containing the radius for the given string.
/// </returns>
private int ParseRadius(string input)
{
foreach (Match match in RadiusRegex.Matches(input))
{
// Split on radius-
int radius;
int.TryParse(match.Value.Split('-')[1], out radius);
return radius;
}
// No rotate - matches the RotateLayer default.
return 0;
}
/// <summary>
/// Returns the correct <see cref="T:System.Drawing.Color"/> for the given string.
/// </summary>
/// <param name="input">
/// The input string containing the value to parse.
/// </param>
/// <returns>
/// The correct <see cref="T:System.Drawing.Color"/>
/// </returns>
private Color ParseColor(string input)
{
foreach (Match match in ColorRegex.Matches(input))
{
// split on color-hex
return ColorTranslator.FromHtml("#" + match.Value.Split('-')[1]);
}
return Color.Transparent;
}
/// <summary>
/// Returns a <see cref="T:System.Boolean"/> either true or false.
/// </summary>
/// <param name="corner">
/// The corner.
/// </param>
/// <param name="input">
/// The input string containing the value to parse.
/// </param>
/// <returns>
/// The correct <see cref="T:System.Boolean"/> true or false.
/// </returns>
private bool ParseCorner(Regex corner, string input)
{
foreach (Match match in corner.Matches(input))
{
// Split on corner-
bool cornerRound;
bool.TryParse(match.Value.Split('-')[1], out cornerRound);
return cornerRound;
}
// No rotate - matches the RotateLayer default.
return true;
}
#endregion
}
}

4
src/ImageProcessor/Properties/AssemblyInfo.cs

@ -32,6 +32,6 @@ using System.Security;
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.5.0.0")]
[assembly: AssemblyFileVersion("1.5.0.0")]
[assembly: AssemblyVersion("1.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]

BIN
src/Nuget/ImageProcessor.1.6.0.0.nupkg

Binary file not shown.

1
src/Nuget/ImageProcessor.Web.2.2.3.0.nupkg.REMOVED.git-id

@ -0,0 +1 @@
2f145d3c3bc539fb4f43d963ef9a863e553785ad
Loading…
Cancel
Save