diff --git a/src/ImageProcessor.Tests/RegularExpressionUnitTests.cs b/src/ImageProcessor.Tests/RegularExpressionUnitTests.cs index fa7cb24d0..e65591c57 100644 --- a/src/ImageProcessor.Tests/RegularExpressionUnitTests.cs +++ b/src/ImageProcessor.Tests/RegularExpressionUnitTests.cs @@ -8,12 +8,9 @@ namespace ImageProcessor.Tests { #region Using using System.Drawing; - - using ImageProcessor.Configuration; using ImageProcessor.Imaging; using ImageProcessor.Imaging.Filters; using ImageProcessor.Imaging.Formats; - using ImageProcessor.Processors; using Microsoft.VisualStudio.TestTools.UnitTesting; #endregion @@ -169,14 +166,14 @@ namespace ImageProcessor.Tests public void TestRotateRegex() { const string Querystring = "rotate=270"; - RotateLayer expected = new RotateLayer(270, Color.Transparent); + const int Expected = 270; Web.Processors.Rotate rotate = new Web.Processors.Rotate(); rotate.MatchRegexIndex(Querystring); - RotateLayer actual = rotate.Processor.DynamicParameter; + int actual = rotate.Processor.DynamicParameter; - Assert.AreEqual(expected, actual); + Assert.AreEqual(Expected, actual); } /// @@ -218,4 +215,4 @@ namespace ImageProcessor.Tests } #endregion } -} +} \ No newline at end of file diff --git a/src/ImageProcessor/ImageProcessor.csproj b/src/ImageProcessor/ImageProcessor.csproj index c11410731..ba02d703a 100644 --- a/src/ImageProcessor/ImageProcessor.csproj +++ b/src/ImageProcessor/ImageProcessor.csproj @@ -106,7 +106,6 @@ - diff --git a/src/ImageProcessor/Imaging/RotateLayer.cs b/src/ImageProcessor/Imaging/RotateLayer.cs deleted file mode 100644 index 0b7c956ba..000000000 --- a/src/ImageProcessor/Imaging/RotateLayer.cs +++ /dev/null @@ -1,104 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) James South. -// Licensed under the Apache License, Version 2.0. -// -// ----------------------------------------------------------------------- - -namespace ImageProcessor.Imaging -{ - #region Using - using System.Drawing; - #endregion - - /// - /// Encapsulates the properties required to rotate an image. - /// - public class RotateLayer - { - #region Constructors - /// - /// Initializes a new instance of the class. - /// - public RotateLayer() - { - this.BackgroundColor = Color.Transparent; - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The angle at which to rotate the image. - /// - public RotateLayer(int angle) - { - this.Angle = angle; - this.BackgroundColor = Color.Transparent; - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The angle at which to rotate the image. - /// - /// - /// The to set as the background color. - /// Used for image formats that do not support transparency - /// - public RotateLayer(int angle, Color backgroundColor) - { - this.Angle = angle; - this.BackgroundColor = backgroundColor; - } - #endregion - - #region Properties - /// - /// Gets or sets the angle at which to rotate the image. - /// - public int Angle { get; set; } - - /// - /// Gets or sets the background color. - /// - public Color BackgroundColor { get; set; } - #endregion - - /// - /// Returns a value that indicates whether the specified object is an - /// object that is equivalent to - /// this object. - /// - /// - /// The object to test. - /// - /// - /// True if the given object is an object that is equivalent to - /// this object; otherwise, false. - /// - public override bool Equals(object obj) - { - RotateLayer rotate = obj as RotateLayer; - - if (rotate == null) - { - return false; - } - - return this.Angle == rotate.Angle && this.BackgroundColor == rotate.BackgroundColor; - } - - /// - /// Returns a hash code value that represents this object. - /// - /// - /// A hash code that represents this object. - /// - public override int GetHashCode() - { - return this.Angle.GetHashCode() + this.BackgroundColor.GetHashCode(); - } - } -} diff --git a/src/ImageProcessor/Processors/Alpha.cs b/src/ImageProcessor/Processors/Alpha.cs index decff92a7..cdd505f84 100644 --- a/src/ImageProcessor/Processors/Alpha.cs +++ b/src/ImageProcessor/Processors/Alpha.cs @@ -19,6 +19,14 @@ namespace ImageProcessor.Processors /// public class Alpha : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Alpha() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/AutoRotate.cs b/src/ImageProcessor/Processors/AutoRotate.cs index a17b6b28f..251ba308b 100644 --- a/src/ImageProcessor/Processors/AutoRotate.cs +++ b/src/ImageProcessor/Processors/AutoRotate.cs @@ -21,6 +21,14 @@ namespace ImageProcessor.Processors /// public class AutoRotate : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public AutoRotate() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/BackgroundColor.cs b/src/ImageProcessor/Processors/BackgroundColor.cs index 3bad95f81..b6d97eb19 100644 --- a/src/ImageProcessor/Processors/BackgroundColor.cs +++ b/src/ImageProcessor/Processors/BackgroundColor.cs @@ -18,6 +18,14 @@ namespace ImageProcessor.Processors /// public class BackgroundColor : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public BackgroundColor() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets the DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Brightness.cs b/src/ImageProcessor/Processors/Brightness.cs index ef4a59c2c..e711d5c19 100644 --- a/src/ImageProcessor/Processors/Brightness.cs +++ b/src/ImageProcessor/Processors/Brightness.cs @@ -19,6 +19,14 @@ namespace ImageProcessor.Processors /// public class Brightness : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Brightness() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Contrast.cs b/src/ImageProcessor/Processors/Contrast.cs index 31d5affcd..dbe6b91c3 100644 --- a/src/ImageProcessor/Processors/Contrast.cs +++ b/src/ImageProcessor/Processors/Contrast.cs @@ -19,6 +19,14 @@ namespace ImageProcessor.Processors /// public class Contrast : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Contrast() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Crop.cs b/src/ImageProcessor/Processors/Crop.cs index c535639d1..6a3cb03c0 100644 --- a/src/ImageProcessor/Processors/Crop.cs +++ b/src/ImageProcessor/Processors/Crop.cs @@ -23,6 +23,14 @@ namespace ImageProcessor.Processors /// public class Crop : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Crop() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Filter.cs b/src/ImageProcessor/Processors/Filter.cs index d09a3b7da..6e3eb8459 100644 --- a/src/ImageProcessor/Processors/Filter.cs +++ b/src/ImageProcessor/Processors/Filter.cs @@ -22,6 +22,14 @@ namespace ImageProcessor.Processors /// public class Filter : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Filter() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Flip.cs b/src/ImageProcessor/Processors/Flip.cs index 174347eb7..0b67ee04b 100644 --- a/src/ImageProcessor/Processors/Flip.cs +++ b/src/ImageProcessor/Processors/Flip.cs @@ -21,6 +21,14 @@ namespace ImageProcessor.Processors /// public class Flip : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Flip() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Format.cs b/src/ImageProcessor/Processors/Format.cs index dad11fbb3..43dac6b35 100644 --- a/src/ImageProcessor/Processors/Format.cs +++ b/src/ImageProcessor/Processors/Format.cs @@ -25,6 +25,14 @@ namespace ImageProcessor.Processors /// public class Format : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Format() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/GaussianBlur.cs b/src/ImageProcessor/Processors/GaussianBlur.cs index 3a3634257..fa8bbb65e 100644 --- a/src/ImageProcessor/Processors/GaussianBlur.cs +++ b/src/ImageProcessor/Processors/GaussianBlur.cs @@ -19,6 +19,14 @@ namespace ImageProcessor.Processors /// public class GaussianBlur : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public GaussianBlur() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets the DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/GaussianSharpen.cs b/src/ImageProcessor/Processors/GaussianSharpen.cs index e7fa4f6b7..c7ea7a4ef 100644 --- a/src/ImageProcessor/Processors/GaussianSharpen.cs +++ b/src/ImageProcessor/Processors/GaussianSharpen.cs @@ -19,6 +19,14 @@ namespace ImageProcessor.Processors /// public class GaussianSharpen : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public GaussianSharpen() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets the DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Quality.cs b/src/ImageProcessor/Processors/Quality.cs index 8df867ae8..bb89a3e6b 100644 --- a/src/ImageProcessor/Processors/Quality.cs +++ b/src/ImageProcessor/Processors/Quality.cs @@ -20,6 +20,14 @@ namespace ImageProcessor.Processors /// public class Quality : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Quality() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Resize.cs b/src/ImageProcessor/Processors/Resize.cs index d0ddcd9b5..1183068c6 100644 --- a/src/ImageProcessor/Processors/Resize.cs +++ b/src/ImageProcessor/Processors/Resize.cs @@ -10,7 +10,6 @@ namespace ImageProcessor.Processors { - #region Using using System; using System.Collections.Generic; using System.Drawing; @@ -19,14 +18,20 @@ namespace ImageProcessor.Processors using System.Globalization; using System.Linq; using ImageProcessor.Imaging; - #endregion /// /// Resizes an image to the given dimensions. /// public class Resize : IGraphicsProcessor { - #region IGraphicsProcessor Members + /// + /// Initializes a new instance of the class. + /// + public Resize() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// @@ -77,7 +82,6 @@ namespace ImageProcessor.Processors return this.ResizeImage(factory, width, height, defaultMaxWidth, defaultMaxHeight, this.RestrictedSizes, mode, anchor, upscale, centerCoordinates); } - #endregion /// /// The resize image. diff --git a/src/ImageProcessor/Processors/Rotate.cs b/src/ImageProcessor/Processors/Rotate.cs index 4a5f27dc2..e9cc4d838 100644 --- a/src/ImageProcessor/Processors/Rotate.cs +++ b/src/ImageProcessor/Processors/Rotate.cs @@ -10,19 +10,24 @@ namespace ImageProcessor.Processors { - #region Using using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; - #endregion /// /// Encapsulates methods to rotate an image. /// public class Rotate : IGraphicsProcessor { - #region IGraphicsProcessor members + /// + /// Initializes a new instance of the class. + /// + public Rotate() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// @@ -80,7 +85,6 @@ namespace ImageProcessor.Processors return image; } - #endregion #region Private Methods /// diff --git a/src/ImageProcessor/Processors/RoundedCorners.cs b/src/ImageProcessor/Processors/RoundedCorners.cs index 19ed6031e..a67fbdb16 100644 --- a/src/ImageProcessor/Processors/RoundedCorners.cs +++ b/src/ImageProcessor/Processors/RoundedCorners.cs @@ -14,8 +14,6 @@ namespace ImageProcessor.Processors using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; - using System.Globalization; - using System.Text.RegularExpressions; using ImageProcessor.Imaging; #endregion @@ -24,6 +22,14 @@ namespace ImageProcessor.Processors /// public class RoundedCorners : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public RoundedCorners() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Saturation.cs b/src/ImageProcessor/Processors/Saturation.cs index 5021a3e35..7c170030e 100644 --- a/src/ImageProcessor/Processors/Saturation.cs +++ b/src/ImageProcessor/Processors/Saturation.cs @@ -24,7 +24,14 @@ namespace ImageProcessor.Processors /// public class Saturation : IGraphicsProcessor { - #region IGraphicsProcessor Members + /// + /// Initializes a new instance of the class. + /// + public Saturation() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// @@ -129,6 +136,5 @@ namespace ImageProcessor.Processors return image; } - #endregion } } \ No newline at end of file diff --git a/src/ImageProcessor/Processors/Tint.cs b/src/ImageProcessor/Processors/Tint.cs index fb19372bb..66843e8a1 100644 --- a/src/ImageProcessor/Processors/Tint.cs +++ b/src/ImageProcessor/Processors/Tint.cs @@ -20,6 +20,14 @@ namespace ImageProcessor.Processors /// public class Tint : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Tint() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. /// diff --git a/src/ImageProcessor/Processors/Vignette.cs b/src/ImageProcessor/Processors/Vignette.cs index 3915d6428..9c18cfae2 100644 --- a/src/ImageProcessor/Processors/Vignette.cs +++ b/src/ImageProcessor/Processors/Vignette.cs @@ -29,6 +29,7 @@ namespace ImageProcessor.Processors public Vignette() { this.DynamicParameter = Color.Black; + this.Settings = new Dictionary(); } /// diff --git a/src/ImageProcessor/Processors/Watermark.cs b/src/ImageProcessor/Processors/Watermark.cs index 4e864037b..241b5efbd 100644 --- a/src/ImageProcessor/Processors/Watermark.cs +++ b/src/ImageProcessor/Processors/Watermark.cs @@ -21,6 +21,14 @@ namespace ImageProcessor.Processors /// public class Watermark : IGraphicsProcessor { + /// + /// Initializes a new instance of the class. + /// + public Watermark() + { + this.Settings = new Dictionary(); + } + /// /// Gets or sets DynamicParameter. ///