Skip to content

Commit 56fdeb5

Browse files
v2.1.2.0
1 parent 6223dfb commit 56fdeb5

23 files changed

+203
-104
lines changed

src/ImageProcessor.Tests/RegularExpressionUnitTests.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,7 @@ public void TestResizeRegex()
132132
public void TestRotateRegex()
133133
{
134134
const string Querystring = "rotate=270";
135-
RotateLayer expected = new RotateLayer
136-
{
137-
Angle = 270,
138-
BackgroundColor = Color.Transparent
139-
};
135+
RotateLayer expected = new RotateLayer(270, Color.Transparent);
140136

141137
Rotate rotate = new Rotate();
142138
rotate.MatchRegexIndex(Querystring);

src/ImageProcessor.Web/Caching/DiskCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ internal async Task<bool> IsNewOrUpdatedFileAsync()
304304
/// </returns>
305305
internal async Task<DateTime> SetCachedLastWriteTimeAsync()
306306
{
307-
// Create Action delegate for IsNewOrUpdatedFile.
307+
// Create Action delegate for SetCachedLastWriteTime.
308308
return await TaskHelpers.Run(() => this.SetCachedLastWriteTime());
309309
}
310310

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("2.1.1.0")]
35-
[assembly: AssemblyFileVersion("2.1.1.0")]
34+
[assembly: AssemblyVersion("2.1.2.0")]
35+
[assembly: AssemblyFileVersion("2.1.2.0")]

src/ImageProcessor/ImageFactory.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public ImageFactory Load(string imagePath)
184184
}
185185

186186
/// <summary>
187-
/// Resets the ImageFactory to its original loaded state.
187+
/// Resets the current image to its original loaded state.
188188
/// </summary>
189189
/// <returns>
190190
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
@@ -213,7 +213,6 @@ public ImageFactory Reset()
213213
return this;
214214
}
215215

216-
217216
#region Manipulation
218217
/// <summary>
219218
/// Adds a query-string to the image factory to allow auto-processing of remote files.
@@ -317,7 +316,7 @@ public ImageFactory Contrast(int percentage)
317316
}
318317

319318
/// <summary>
320-
/// Crops an image to the given coordinates.
319+
/// Crops the current image to the given location and size.
321320
/// </summary>
322321
/// <param name="rectangle">
323322
/// The <see cref="T:System.Drawing.Rectangle"/> containing the coordinates to crop the image to.
@@ -338,7 +337,7 @@ public ImageFactory Crop(Rectangle rectangle)
338337
}
339338

340339
/// <summary>
341-
/// Applies a filter to an image.
340+
/// Applies a filter to the current image.
342341
/// </summary>
343342
/// <param name="filterName">
344343
/// The name of the filter to add to the image.
@@ -359,7 +358,7 @@ public ImageFactory Filter(string filterName)
359358
}
360359

361360
/// <summary>
362-
/// Flips an image either horizontally or vertically.
361+
/// Flips the current image either horizontally or vertically.
363362
/// </summary>
364363
/// <param name="flipVertically">
365364
/// Whether to flip the image vertically.
@@ -384,7 +383,7 @@ public ImageFactory Flip(bool flipVertically)
384383
}
385384

386385
/// <summary>
387-
/// Sets the output format of the image to the matching <see cref="T:System.Drawing.Imaging.ImageFormat"/>.
386+
/// Sets the output format of the current image to the matching <see cref="T:System.Drawing.Imaging.ImageFormat"/>.
388387
/// </summary>
389388
/// <param name="imageFormat">The <see cref="T:System.Drawing.Imaging.ImageFormat"/>. to set the image to.</param>
390389
/// <returns>
@@ -401,7 +400,10 @@ public ImageFactory Format(ImageFormat imageFormat)
401400
}
402401

403402
/// <summary>
404-
/// Applies a filter to an image.
403+
/// Alters the output quality of the current image.
404+
/// <remarks>
405+
/// This method will only effect the output quality of jpeg images
406+
/// </remarks>
405407
/// </summary>
406408
/// <param name="percentage">A value between 1 and 100 to set the quality to.</param>
407409
/// <returns>
@@ -418,7 +420,7 @@ public ImageFactory Quality(int percentage)
418420
}
419421

420422
/// <summary>
421-
/// Resizes an image to the given dimensions.
423+
/// Resizes the current image to the given dimensions.
422424
/// </summary>
423425
/// <param name="size">
424426
/// The <see cref="T:System.Drawing.Size"/> containing the width and height to set the image to.
@@ -517,7 +519,7 @@ public ImageFactory Vignette()
517519
}
518520

519521
/// <summary>
520-
/// Adds a text based watermark to the image
522+
/// Adds a text based watermark to the current image.
521523
/// </summary>
522524
/// <param name="textLayer">
523525
/// The <see cref="T:ImageProcessor.Imaging.TextLayer"/> containing the properties necessary to add

src/ImageProcessor/Imaging/RotateLayer.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,34 @@ public RotateLayer()
2626
{
2727
this.BackgroundColor = Color.Transparent;
2828
}
29+
30+
/// <summary>
31+
/// Initializes a new instance of the <see cref="RotateLayer"/> class.
32+
/// </summary>
33+
/// <param name="angle">
34+
/// The angle at which to rotate the image.
35+
/// </param>
36+
public RotateLayer(int angle)
37+
{
38+
this.Angle = angle;
39+
this.BackgroundColor = Color.Transparent;
40+
}
41+
42+
/// <summary>
43+
/// Initializes a new instance of the <see cref="RotateLayer"/> class.
44+
/// </summary>
45+
/// <param name="angle">
46+
/// The angle at which to rotate the image.
47+
/// </param>
48+
/// <param name="backgroundColor">
49+
/// The <see cref="T:System.Drawing.Color"/> to set as the background color.
50+
/// <remarks>Used for image formats that do not support transparency</remarks>
51+
/// </param>
52+
public RotateLayer(int angle, Color backgroundColor)
53+
{
54+
this.Angle = angle;
55+
this.BackgroundColor = backgroundColor;
56+
}
2957
#endregion
3058

3159
#region Properties

src/ImageProcessor/Imaging/TextLayer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace ImageProcessor.Imaging
1414
#endregion
1515

1616
/// <summary>
17-
/// Enacapsulates the properties required to add a layer of text to an image.
17+
/// Encapsulates the properties required to add a layer of text to an image.
1818
/// </summary>
1919
public class TextLayer
2020
{

src/ImageProcessor/Processors/Rotate.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,20 @@ public int MatchRegexIndex(string queryString)
100100
// Set the index on the first instance only.
101101
this.SortOrder = match.Index;
102102

103-
RotateLayer rotateLayer = new RotateLayer();
103+
RotateLayer rotateLayer;
104104

105105
string toParse = match.Value;
106106

107107
if (toParse.Contains("bgcolor"))
108108
{
109-
rotateLayer.Angle = this.ParseAngle(toParse);
110-
rotateLayer.BackgroundColor = this.ParseColor(toParse);
109+
rotateLayer = new RotateLayer(this.ParseAngle(toParse), this.ParseColor(toParse));
111110
}
112111
else
113112
{
114113
int degrees;
115114
int.TryParse(match.Value.Split('=')[1], out degrees);
116115

117-
rotateLayer.Angle = degrees;
116+
rotateLayer = new RotateLayer(degrees);
118117
}
119118

120119
this.DynamicParameter = rotateLayer;

src/ImageProcessor/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
//
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
35-
[assembly: AssemblyVersion("1.4.2.0")]
36-
[assembly: AssemblyFileVersion("1.4.2.0")]
35+
[assembly: AssemblyVersion("1.5.0.0")]
36+
[assembly: AssemblyFileVersion("1.5.0.0")]
3737

26.2 KB
Binary file not shown.
69.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)