Browse Source

Tweaks and tidy up

Former-commit-id: 36cfa7389463c1afaf11c4cdc6f7d0db2ae419ea
af/merge-core
James South 12 years ago
parent
commit
371b92c71e
  1. 2
      src/ImageProcessor/ImageProcessor.csproj
  2. 14
      src/ImageProcessor/Processors/Alpha.cs
  3. 15
      src/ImageProcessor/Processors/Brightness.cs
  4. 2
      src/ImageProcessor/Processors/Constrain.cs
  5. 14
      src/ImageProcessor/Processors/Contrast.cs
  6. 2
      src/ImageProcessor/Processors/Crop.cs
  7. 13
      src/ImageProcessor/Processors/Filter.cs
  8. 11
      src/ImageProcessor/Processors/Flip.cs
  9. 11
      src/ImageProcessor/Processors/IGraphicsProcessor.cs
  10. 14
      src/ImageProcessor/Processors/Quality.cs
  11. 11
      src/ImageProcessor/Processors/Rotate.cs
  12. 11
      src/ImageProcessor/Processors/RoundedCorners.cs
  13. 15
      src/ImageProcessor/Processors/Saturation.cs
  14. 13
      src/ImageProcessor/Processors/Vignette.cs
  15. 9
      src/TestWebsites/NET4/Test_Website.csproj
  16. 31
      src/TestWebsites/NET4/Web.config
  17. 3
      src/TestWebsites/NET4/config/imageprocessor/cache.config
  18. 18
      src/TestWebsites/NET4/config/imageprocessor/processing.config
  19. 8
      src/TestWebsites/NET4/config/imageprocessor/security.config
  20. 1
      src/TestWebsites/NET45/Test_Website_NET45/Images/Thumbs.db.REMOVED.git-id

2
src/ImageProcessor/ImageProcessor.csproj

@ -88,7 +88,7 @@
<Compile Include="Processors\Contrast.cs" />
<Compile Include="Processors\ResizeBase.cs" />
<Compile Include="Processors\RoundedCorners.cs" />
<Compile Include="Processors\Saturate.cs" />
<Compile Include="Processors\Saturation.cs" />
<Compile Include="Processors\Flip.cs" />
<Compile Include="Processors\Rotate.cs" />
<Compile Include="Processors\Crop.cs" />

14
src/ImageProcessor/Processors/Alpha.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Alpha.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Encapsulates methods to change the alpha component of the image to effect its transparency.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{
@ -119,7 +122,8 @@ namespace ImageProcessor.Processors
{
int alphaPercent = this.DynamicParameter;
// Dont use an object initializer here.
// Don't use an object initializer here.
// ReSharper disable once UseObjectOrCollectionInitializer
newImage = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppPArgb);
newImage.Tag = image.Tag;

15
src/ImageProcessor/Processors/Brightness.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Brightness.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Encapsulates methods to change the brightness component of the image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{
@ -12,7 +15,6 @@ namespace ImageProcessor.Processors
using System.Drawing;
using System.Drawing.Imaging;
using System.Text.RegularExpressions;
using ImageProcessor.Helpers.Extensions;
#endregion
/// <summary>
@ -120,7 +122,8 @@ namespace ImageProcessor.Processors
{
float brightnessFactor = (float)this.DynamicParameter / 100;
// Dont use an object initializer here.
// Don't use an object initializer here.
// ReSharper disable once UseObjectOrCollectionInitializer
newImage = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppPArgb);
newImage.Tag = image.Tag;

2
src/ImageProcessor/Processors/Constrain.cs

@ -15,8 +15,6 @@ namespace ImageProcessor.Processors
using System.Drawing;
using System.Text.RegularExpressions;
using ImageProcessor.Helpers.Extensions;
using ImageProcessor.Imaging;
#endregion
/// <summary>

14
src/ImageProcessor/Processors/Contrast.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Contrast.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Encapsulates methods to change the contrast component of the image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{
@ -123,7 +126,8 @@ namespace ImageProcessor.Processors
contrastFactor++;
float factorTransform = 0.5f * (1.0f - contrastFactor);
// Dont use an object initializer here.
// Don't use an object initializer here.
// ReSharper disable once UseObjectOrCollectionInitializer
newImage = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppPArgb);
newImage.Tag = image.Tag;

2
src/ImageProcessor/Processors/Crop.cs

@ -144,7 +144,7 @@ namespace ImageProcessor.Processors
rectangle.Height = sourceHeight - rectangle.Y;
}
// Dont use an object initializer here.
// Don't use an object initializer here.
newImage = new Bitmap(rectangle.Width, rectangle.Height, PixelFormat.Format32bppPArgb);
newImage.Tag = image.Tag;

13
src/ImageProcessor/Processors/Filter.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Filter.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Encapsulates methods with which to add filters to an image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{
@ -116,7 +119,7 @@ namespace ImageProcessor.Processors
try
{
// Dont use an object initializer here.
// Don't use an object initializer here.
newImage = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppPArgb);
newImage.Tag = image.Tag;

11
src/ImageProcessor/Processors/Flip.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Flip.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Flips an image horizontally or vertically.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{

11
src/ImageProcessor/Processors/IGraphicsProcessor.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IGraphicsProcessor.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Defines properties and methods for ImageProcessor Plugins.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{

14
src/ImageProcessor/Processors/Quality.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Quality.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Encapsulates methods to change the quality component of the image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{
@ -11,11 +14,10 @@ namespace ImageProcessor.Processors
using System.Collections.Generic;
using System.Drawing;
using System.Text.RegularExpressions;
using ImageProcessor.Helpers.Extensions;
#endregion
/// <summary>
/// TODO: Update summary.
/// Encapsulates methods to change the quality component of the image.
/// </summary>
public class Quality : IGraphicsProcessor
{

11
src/ImageProcessor/Processors/Rotate.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Rotate.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Encapsulates methods to rotate an image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{

11
src/ImageProcessor/Processors/RoundedCorners.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RoundedCorners.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Encapsulates methods to add rounded corners to an image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{

15
src/ImageProcessor/Processors/Saturate.cs → src/ImageProcessor/Processors/Saturation.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// <copyright file="Saturate.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Saturation.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Encapsulates methods to change the saturation component of the image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{
@ -134,7 +137,7 @@ namespace ImageProcessor.Processors
float saturationComplementG = 0.6094f * saturationComplement;
float saturationComplementB = 0.0820f * saturationComplement;
// Dont use an object initializer here.
// Don't use an object initializer here.
newImage = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppPArgb);
newImage.Tag = image.Tag;

13
src/ImageProcessor/Processors/Vignette.cs

@ -1,9 +1,12 @@
// -----------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Vignette.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// -----------------------------------------------------------------------
// <summary>
// Encapsulates methods with which to add a vignette image effect to an image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{
@ -116,7 +119,7 @@ namespace ImageProcessor.Processors
try
{
// Dont use an object initializer here.
// Don't use an object initializer here.
newImage = new Bitmap(image);
newImage.Tag = image.Tag;

9
src/TestWebsites/NET4/Test_Website.csproj

@ -146,6 +146,15 @@
<ItemGroup>
<Content Include="Views\Home\Index.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="config\imageprocessor\cache.config" />
</ItemGroup>
<ItemGroup>
<Content Include="config\imageprocessor\processing.config" />
</ItemGroup>
<ItemGroup>
<Content Include="config\imageprocessor\security.config" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

31
src/TestWebsites/NET4/Web.config

@ -12,6 +12,11 @@
<section name="cache" requirePermission="false" type="ImageProcessor.Web.Config.ImageCacheSection, ImageProcessor.Web" />
</sectionGroup>
</configSections>
<imageProcessor >
<security configSource="config\imageprocessor\security.config"/>
<cache configSource="config\imageprocessor\cache.config"/>
<processing configSource="config\imageprocessor\processing.config"/>
</imageProcessor>
<appSettings>
<add key="webpages:Version" value="1.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
@ -68,30 +73,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<imageProcessor>
<security allowRemoteDownloads="true" timeout="300000" maxBytes="524288" remotePrefix="/remote.axd">
<whiteList>
<add url="http://images.mymovies.net"/>
<add url="http://www.theworldeffect.com" />
<add url="http://maps.googleapis.com" extensionLess="true" imageFormat="png"/>
</whiteList>
</security>
<cache virtualPath="~/cache" maxDays="56" />
<processing>
<plugins>
<plugin name="Resize">
<settings>
<setting key="MaxWidth" value="1024" />
<setting key="MaxHeight" value="768" />
</settings>
</plugin>
<plugin name="Constrain">
<settings>
<setting key="MaxWidth" value="3000"/>
<setting key="MaxHeight" value="3000"/>
</settings>
</plugin>
</plugins>
</processing>
</imageProcessor>
</configuration>

3
src/TestWebsites/NET4/config/imageprocessor/cache.config

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8" ?>
<cache virtualPath="~/app_data/cache" maxDays="56"/>

18
src/TestWebsites/NET4/config/imageprocessor/processing.config

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<processing>
<plugins>
<plugin name="Resize">
<settings>
<setting key="MaxWidth" value="3000"/>
<setting key="MaxHeight" value="3000"/>
</settings>
</plugin>
<plugin name="Constrain">
<settings>
<setting key="MaxWidth" value="3000"/>
<setting key="MaxHeight" value="3000"/>
</settings>
</plugin>
</plugins>
</processing>

8
src/TestWebsites/NET4/config/imageprocessor/security.config

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<security allowRemoteDownloads="true" timeout="300000" maxBytes="524288" remotePrefix="/remote.axd">
<whiteList>
<add url="http://images.mymovies.net"/>
<add url="http://www.theworldeffect.com" />
<add url="http://maps.googleapis.com" extensionLess="true" imageFormat="png"/>
</whiteList>
</security>

1
src/TestWebsites/NET45/Test_Website_NET45/Images/Thumbs.db.REMOVED.git-id

@ -0,0 +1 @@
90ba9cd46c99300489b004f2b4df360b84e4444d
Loading…
Cancel
Save