Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60e2147

Browse files
Prepping for 2.0.0 release
1 parent 9221e05 commit 60e2147

22 files changed

+98
-791
lines changed

src/ImageProcessor.Tests/RegularExpressionUnitTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public class RegularExpressionUnitTests
1818
[TestMethod]
1919
public void TestAlphaRegex()
2020
{
21-
string querystring = "alpha=56";
22-
int expected = 56;
21+
const string querystring = "alpha=56";
22+
const int expected = 56;
2323

2424
Alpha alpha = new Alpha();
2525
alpha.MatchRegexIndex(querystring);
@@ -60,6 +60,7 @@ public void TestQualityRegex()
6060
[TestMethod]
6161
public void TestRotateRegex()
6262
{
63+
// Why does this fail?
6364
string querystring = "rotate=270";
6465
RotateLayer expected = new RotateLayer
6566
{
@@ -72,8 +73,6 @@ public void TestRotateRegex()
7273

7374
RotateLayer actual = rotate.DynamicParameter;
7475

75-
Debug.Print("{0}{1}", actual.Angle, actual.BackgroundColor);
76-
7776
Assert.AreEqual<RotateLayer>(expected, actual);
7877
}
7978
#endregion

src/ImageProcessor.Web/HttpModules/ImageProcessingModule.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace ImageProcessor.Web.HttpModules
1111
using System;
1212
using System.IO;
1313
using System.Net;
14+
using System.Reflection;
1415
using System.Web;
1516
using System.Web.Hosting;
1617
using ImageProcessor.Helpers.Extensions;
@@ -40,6 +41,11 @@ public class ImageProcessingModule : IHttpModule
4041
/// The object to lock against.
4142
/// </summary>
4243
private static readonly object SyncRoot = new object();
44+
45+
/// <summary>
46+
/// The assembly version.
47+
/// </summary>
48+
private static readonly string AssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
4349
#endregion
4450

4551
#region IHttpModule Members
@@ -232,6 +238,8 @@ private void SetHeaders(HttpContext context, string responseType)
232238

233239
response.ContentType = responseType;
234240

241+
response.AddHeader("Image-Served-By", "ImageProcessor/" + AssemblyVersion);
242+
235243
HttpCachePolicy cache = response.Cache;
236244

237245
cache.VaryByHeaders["Accept-Encoding"] = true;

src/ImageProcessor.Web/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
//
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
34-
[assembly: AssemblyVersion("1.3.0.0")]
35-
[assembly: AssemblyFileVersion("1.3.0.0")]
34+
[assembly: AssemblyVersion("2.0.0.0")]
35+
[assembly: AssemblyFileVersion("2.0.0.0")]

src/ImageProcessor/ImageFactory.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class ImageFactory : IDisposable
7777
public string ImagePath { get; private set; }
7878

7979
/// <summary>
80-
/// Gets the querystring params for web image manipulation.
80+
/// Gets the query-string parameters for web image manipulation.
8181
/// </summary>
8282
public string QueryString { get; private set; }
8383

@@ -177,9 +177,9 @@ public ImageFactory Load(string imagePath)
177177

178178
#region Manipulation
179179
/// <summary>
180-
/// Adds a querystring to the image factory to allow autoprocessing of remote files.
180+
/// Adds a query-string to the image factory to allow auto-processing of remote files.
181181
/// </summary>
182-
/// <param name="query">The querystring parameter to process.</param>
182+
/// <param name="query">The query-string parameter to process.</param>
183183
/// <returns>
184184
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
185185
/// </returns>
@@ -533,7 +533,7 @@ protected virtual void Dispose(bool disposing)
533533

534534
/// <summary>
535535
/// Uses the <see cref="T:ImageProcessor.Imaging.OctreeQuantizer"/>
536-
/// to fix the colour palette of gif images.
536+
/// to fix the color palette of gif images.
537537
/// </summary>
538538
private void FixGifs()
539539
{

src/ImageProcessor/Imaging/Filters/BlackWhiteMatrixFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace ImageProcessor.Imaging.Filters
1919
/// <summary>
2020
/// Encapsulates methods with which to add a black and white filter to an image.
2121
/// </summary>
22-
class BlackWhiteMatrixFilter : IMatrixFilter
22+
internal class BlackWhiteMatrixFilter : IMatrixFilter
2323
{
2424
/// <summary>
25-
/// Gets the <see cref="T:System.Drawing.Imaging.ColoMatrix"/> for this filter instance.
25+
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
2626
/// </summary>
2727
public ColorMatrix Matrix
2828
{

src/ImageProcessor/Imaging/Filters/ComicMatrixFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace ImageProcessor.Imaging.Filters
1717
/// <summary>
1818
/// Encapsulates methods with which to add a comic filter to an image.
1919
/// </summary>
20-
class ComicMatrixFilter : IMatrixFilter
20+
internal class ComicMatrixFilter : IMatrixFilter
2121
{
2222
/// <summary>
2323
/// Enumurates Argb colour channels.

src/ImageProcessor/Imaging/Filters/GothamMatrixFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ namespace ImageProcessor.Imaging.Filters
2020
/// <summary>
2121
/// Encapsulates methods with which to add a gotham filter to an image.
2222
/// </summary>
23-
class GothamMatrixFilter : IMatrixFilter
23+
internal class GothamMatrixFilter : IMatrixFilter
2424
{
2525
/// <summary>
26-
/// Gets the <see cref="T:System.Drawing.Imaging.ColoMatrix"/> for this filter instance.
26+
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
2727
/// </summary>
2828
public ColorMatrix Matrix
2929
{

src/ImageProcessor/Imaging/Filters/GreyScaleMatrixFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace ImageProcessor.Imaging.Filters
1919
/// <summary>
2020
/// Encapsulates methods with which to add a greyscale filter to an image.
2121
/// </summary>
22-
class GreyScaleMatrixFilter : IMatrixFilter
22+
internal class GreyScaleMatrixFilter : IMatrixFilter
2323
{
2424
/// <summary>
25-
/// Gets the <see cref="T:System.Drawing.Imaging.ColoMatrix"/> for this filter instance.
25+
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
2626
/// </summary>
2727
public ColorMatrix Matrix
2828
{

src/ImageProcessor/Imaging/Filters/HiSatchMatrixFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace ImageProcessor.Imaging.Filters
1919
/// <summary>
2020
/// Encapsulates methods with which to add a high saturated filter to an image.
2121
/// </summary>
22-
class HiSatchMatrixFilter : IMatrixFilter
22+
internal class HiSatchMatrixFilter : IMatrixFilter
2323
{
2424
/// <summary>
25-
/// Gets the <see cref="T:System.Drawing.Imaging.ColoMatrix"/> for this filter instance.
25+
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
2626
/// </summary>
2727
public ColorMatrix Matrix
2828
{

src/ImageProcessor/Imaging/Filters/IMatrixFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace ImageProcessor.Imaging.Filters
1818
interface IMatrixFilter
1919
{
2020
/// <summary>
21-
/// Gets the <see cref="T:System.Drawing.ColoMatrix"/> for this filter instance.
21+
/// Gets the <see cref="T:System.Drawing.ColorMatrix"/> for this filter instance.
2222
/// </summary>
2323
ColorMatrix Matrix { get; }
2424

src/ImageProcessor/Imaging/Filters/InvertMatrixFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace ImageProcessor.Imaging.Filters
1919
/// <summary>
2020
/// Encapsulates methods with which to add an inverted filter to an image.
2121
/// </summary>
22-
class InvertMatrixFilter : IMatrixFilter
22+
internal class InvertMatrixFilter : IMatrixFilter
2323
{
2424
/// <summary>
25-
/// Gets the <see cref="T:System.Drawing.Imaging.ColoMatrix"/> for this filter instance.
25+
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
2626
/// </summary>
2727
public ColorMatrix Matrix
2828
{

src/ImageProcessor/Imaging/Filters/LoSatchMatrixFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace ImageProcessor.Imaging.Filters
1919
/// <summary>
2020
/// Encapsulates methods with which to add a low saturated filter to an image.
2121
/// </summary>
22-
class LoSatchMatrixFilter : IMatrixFilter
22+
internal class LoSatchMatrixFilter : IMatrixFilter
2323
{
2424
/// <summary>
25-
/// Gets the <see cref="T:System.Drawing.Imaging.ColoMatrix"/> for this filter instance.
25+
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
2626
/// </summary>
2727
public ColorMatrix Matrix
2828
{

src/ImageProcessor/Imaging/Filters/LomographMatrixFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ namespace ImageProcessor.Imaging.Filters
2020
/// <summary>
2121
/// Encapsulates methods with which to add a lomograph filter to an image.
2222
/// </summary>
23-
class LomographMatrixFilter : IMatrixFilter
23+
internal class LomographMatrixFilter : IMatrixFilter
2424
{
2525
/// <summary>
26-
/// Gets the <see cref="T:System.Drawing.Imaging.ColoMatrix"/> for this filter instance.
26+
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
2727
/// </summary>
2828
public ColorMatrix Matrix
2929
{

src/ImageProcessor/Imaging/Filters/PolaroidMatrixFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ namespace ImageProcessor.Imaging.Filters
2121
/// <summary>
2222
/// Encapsulates methods with which to add a polaroid filter to an image.
2323
/// </summary>
24-
class PolaroidMatrixFilter : IMatrixFilter
24+
internal class PolaroidMatrixFilter : IMatrixFilter
2525
{
2626
/// <summary>
27-
/// Gets the <see cref="T:System.Drawing.Imaging.ColoMatrix"/> for this filter instance.
27+
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
2828
/// </summary>
2929
public ColorMatrix Matrix
3030
{

src/ImageProcessor/Imaging/Filters/SepiaMatrixFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace ImageProcessor.Imaging.Filters
1919
/// <summary>
2020
/// Encapsulates methods with which to add a sepia filter to an image.
2121
/// </summary>
22-
class SepiaMatrixFilter : IMatrixFilter
22+
internal class SepiaMatrixFilter : IMatrixFilter
2323
{
2424
/// <summary>
25-
/// Gets the <see cref="T:System.Drawing.Imaging.ColoMatrix"/> for this filter instance.
25+
/// Gets the <see cref="T:System.Drawing.Imaging.ColorMatrix"/> for this filter instance.
2626
/// </summary>
2727
public ColorMatrix Matrix
2828
{

src/ImageProcessor/Imaging/RotateLayer.cs

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
namespace ImageProcessor.Imaging
99
{
1010
#region Using
11+
using System;
12+
using System.Collections.Generic;
1113
using System.Drawing;
1214
#endregion
1315

1416
/// <summary>
15-
/// Enacapsulates the properties required to rotate an image.
17+
/// Encapsulates the properties required to rotate an image.
1618
/// </summary>
17-
public class RotateLayer
19+
public class RotateLayer : IEqualityComparer<RotateLayer>
1820
{
1921
#region Constructors
2022
/// <summary>
@@ -37,5 +39,58 @@ public RotateLayer()
3739
/// </summary>
3840
public Color BackgroundColor { get; set; }
3941
#endregion
42+
43+
/// <summary>
44+
/// Returns a value indicating whether this instance is equal to another <see cref="ImageProcessor.Imaging.RotateLayer"/>.
45+
/// </summary>
46+
/// <param name="other">
47+
/// The other <see cref="ImageProcessor.Imaging.RotateLayer"/> to compare to.
48+
/// </param>
49+
/// <returns>
50+
/// True if this instance is equal to another <see cref="ImageProcessor.Imaging.RotateLayer"/>; otherwise, false.
51+
/// </returns>
52+
public bool Equals(RotateLayer other)
53+
{
54+
return this.Angle.Equals(other.Angle) && this.BackgroundColor.Equals(other.BackgroundColor);
55+
}
56+
57+
/// <summary>
58+
/// Determines whether the specified objects are equal.
59+
/// </summary>
60+
/// <returns>
61+
/// true if the specified objects are equal; otherwise, false.
62+
/// </returns>
63+
/// <param name="x">
64+
/// The first object of type <see cref="ImageProcessor.Imaging.RotateLayer"/> to compare.
65+
/// </param>
66+
/// <param name="y">
67+
/// The second object of type <see cref="ImageProcessor.Imaging.RotateLayer"/> to compare.
68+
/// </param>
69+
public bool Equals(RotateLayer x, RotateLayer y)
70+
{
71+
return x.Angle.Equals(y.Angle) && x.BackgroundColor.Equals(y.BackgroundColor);
72+
}
73+
74+
/// <summary>
75+
/// Returns a hash code for the specified object.
76+
/// </summary>
77+
/// <returns>
78+
/// A hash code for the specified object.
79+
/// </returns>
80+
/// <param name="obj">
81+
/// The <see cref="T:System.Object"/> for which a hash code is to be returned.
82+
/// </param>
83+
/// <exception cref="T:System.ArgumentNullException">
84+
/// The type of <paramref name="obj"/> is a reference type and <paramref name="obj"/> is null.
85+
/// </exception>
86+
public int GetHashCode(RotateLayer obj)
87+
{
88+
if (obj == null)
89+
{
90+
throw new ArgumentNullException();
91+
}
92+
93+
return this.Angle.GetHashCode() + this.BackgroundColor.GetHashCode();
94+
}
4095
}
4196
}

0 commit comments

Comments
 (0)