Browse Source

Refactoring and sense checking

Former-commit-id: 152ad831191fe1413038822f39a0a4fcdcda8ab2
af/merge-core
James South 12 years ago
parent
commit
3053267c3d
  1. 6
      build/Build.bat
  2. 14
      build/NuSpecs/ImageProcessor.Web.Config.nuspec
  3. 4
      build/NuSpecs/ImageProcessor.Web.nuspec
  4. 1
      build/NuSpecs/ImageProcessor.nuspec
  5. 10
      build/content/ImageProcessor.Web.Config/web.config.transform
  6. 4
      build/content/ImageProcessor.Web/web.config.transform
  7. 3
      src/ImageProcessor.Web/NET45/Caching/DiskCache.cs
  8. 2
      src/ImageProcessor.Web/NET45/Configuration/ImageCacheSection.cs
  9. 3
      src/ImageProcessor.Web/NET45/Configuration/Resources/processing.config
  10. 3
      src/ImageProcessor.Web/NET45/Helpers/CommonParameterParserUtility.cs
  11. 2
      src/ImageProcessor.Web/NET45/HttpModules/ImageProcessingModule.cs
  12. 3
      src/ImageProcessor.Web/NET45/Processors/Crop.cs
  13. 8
      src/ImageProcessor.Web/NET45/Processors/Format.cs
  14. 3
      src/ImageProcessor.Web/NET45/Processors/Resize.cs
  15. 3
      src/ImageProcessor.Web/NET45/Processors/Watermark.cs
  16. 4
      src/ImageProcessor.Web/NET45/Properties/AssemblyInfo.cs
  17. 3
      src/ImageProcessor/Common/Exceptions/ImageFormatException.cs
  18. 2
      src/ImageProcessor/Common/Exceptions/ImageProcessingException.cs
  19. 2
      src/ImageProcessor/Common/Extensions/DoubleExtensions.cs
  20. 2
      src/ImageProcessor/Common/Extensions/IntegerExtensions.cs
  21. 6
      src/ImageProcessor/Common/Extensions/StringExtensions.cs
  22. 3
      src/ImageProcessor/Configuration/ImageProcessorBootstrapper.cs
  23. 3
      src/ImageProcessor/ImageFactory.cs
  24. 10
      src/ImageProcessor/ImageProcessor.csproj
  25. 2
      src/ImageProcessor/Imaging/Convolution.cs
  26. 4
      src/ImageProcessor/Imaging/Filters/ComicMatrixFilter.cs
  27. 85
      src/ImageProcessor/Imaging/Formats/WebPFormat.cs
  28. 3
      src/ImageProcessor/Processors/Alpha.cs
  29. 3
      src/ImageProcessor/Processors/AutoRotate.cs
  30. 3
      src/ImageProcessor/Processors/BackgroundColor.cs
  31. 3
      src/ImageProcessor/Processors/Brightness.cs
  32. 3
      src/ImageProcessor/Processors/Contrast.cs
  33. 3
      src/ImageProcessor/Processors/Crop.cs
  34. 3
      src/ImageProcessor/Processors/Filter.cs
  35. 3
      src/ImageProcessor/Processors/Flip.cs
  36. 3
      src/ImageProcessor/Processors/Format.cs
  37. 3
      src/ImageProcessor/Processors/GaussianBlur.cs
  38. 3
      src/ImageProcessor/Processors/GaussianSharpen.cs
  39. 3
      src/ImageProcessor/Processors/Quality.cs
  40. 3
      src/ImageProcessor/Processors/Resize.cs
  41. 3
      src/ImageProcessor/Processors/Rotate.cs
  42. 3
      src/ImageProcessor/Processors/RoundedCorners.cs
  43. 3
      src/ImageProcessor/Processors/Saturation.cs
  44. 3
      src/ImageProcessor/Processors/Tint.cs
  45. 3
      src/ImageProcessor/Processors/Vignette.cs
  46. 3
      src/ImageProcessor/Processors/Watermark.cs
  47. 4
      src/ImageProcessor/Properties/AssemblyInfo.cs
  48. 41
      src/TestWebsites/NET4/config/imageprocessor/processing.config
  49. 2
      src/TestWebsites/NET45/Test_Website_NET45/Views/Web.config
  50. 5
      src/TestWebsites/NET45/Test_Website_NET45/Web.config
  51. 2
      src/TestWebsites/NET45/Test_Website_NET45/config/imageprocessor/processing.config
  52. 4
      src/TestWebsites/NET45/Test_Website_NET45/config/imageprocessor/security.config

6
build/Build.bat

@ -1,7 +1,7 @@
@ECHO OFF @ECHO OFF
SET version=1.9.3.0 SET version=2.0.0.0
SET webversion=3.2.7.0 SET webversion=4.0.0.0
SET webconfigversion=1.1.2.0 SET webconfigversion=2.0.0.0
ECHO Building ImageProcessor %version%, ImageProcess.Web %webversion% and ImageProcess.Web.Config %webconfigversion% ECHO Building ImageProcessor %version%, ImageProcess.Web %webversion% and ImageProcess.Web.Config %webconfigversion%

14
build/NuSpecs/ImageProcessor.Web.Config.nuspec

@ -21,19 +21,19 @@ Feedback is always welcome</description>
<tags>Image Imaging ASP Performance Processing HttpModule Cache Resize Rotate RoundedCorners Flip Crop Filter Effects Quality Watermark Alpha Vignette Saturation Brightness Contrast Gif Jpg Jpeg Bitmap Png Fluent GDI Gaussian Blur Sharpen Tint Quantizer Animated</tags> <tags>Image Imaging ASP Performance Processing HttpModule Cache Resize Rotate RoundedCorners Flip Crop Filter Effects Quality Watermark Alpha Vignette Saturation Brightness Contrast Gif Jpg Jpeg Bitmap Png Fluent GDI Gaussian Blur Sharpen Tint Quantizer Animated</tags>
<dependencies> <dependencies>
<group targetFramework=".NETFramework4.0"> <group targetFramework=".NETFramework4.0">
<dependency id="ImageProcessor" version="1.9.3.0" /> <dependency id="ImageProcessor" version="2.0.0.0" />
<dependency id="ImageProcessor.Web" version="3.2.7.0" /> <dependency id="ImageProcessor.Web" version="4.0.0.0" />
</group> </group>
<group targetFramework=".NETFramework4.5"> <group targetFramework=".NETFramework4.5">
<dependency id="ImageProcessor" version="1.9.3.0" /> <dependency id="ImageProcessor" version="2.0.0.0" />
<dependency id="ImageProcessor.Web" version="3.2.7.0" /> <dependency id="ImageProcessor.Web" version="4.0.0.0" />
</group> </group>
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>
<file src="..\..\src\ImageProcessor.Web\NET45\Config\Resources\cache.config" target="content\config\imageprocessor\cache.config" /> <file src="..\..\src\ImageProcessor.Web\NET45\Configuration\Resources\cache.config" target="content\config\imageprocessor\cache.config" />
<file src="..\..\src\ImageProcessor.Web\NET45\Config\Resources\processing.config" target="content\config\imageprocessor\processing.config" /> <file src="..\..\src\ImageProcessor.Web\NET45\Configuration\Resources\processing.config" target="content\config\imageprocessor\processing.config" />
<file src="..\..\src\ImageProcessor.Web\NET45\Config\Resources\security.config" target="content\config\imageprocessor\security.config" /> <file src="..\..\src\ImageProcessor.Web\NET45\Configuration\Resources\security.config" target="content\config\imageprocessor\security.config" />
<file src="..\content\ImageProcessor.Web.Config\web.config.transform" target="content\web.config.transform" /> <file src="..\content\ImageProcessor.Web.Config\web.config.transform" target="content\web.config.transform" />
</files> </files>
</package> </package>

4
build/NuSpecs/ImageProcessor.Web.nuspec

@ -27,10 +27,10 @@ Feedback is always welcome</description>
<group targetFramework=".NETFramework4.0"> <group targetFramework=".NETFramework4.0">
<dependency id="Microsoft.Bcl.Async" version="1.0.168" /> <dependency id="Microsoft.Bcl.Async" version="1.0.168" />
<dependency id="Microsoft.Bcl" version="1.1.9" /> <dependency id="Microsoft.Bcl" version="1.1.9" />
<dependency id="ImageProcessor" version="1.9.3.0" /> <dependency id="ImageProcessor" version="2.0.0.0" />
</group> </group>
<group targetFramework=".NETFramework4.5"> <group targetFramework=".NETFramework4.5">
<dependency id="ImageProcessor" version="1.9.3.0" /> <dependency id="ImageProcessor" version="2.0.0.0" />
</group> </group>
</dependencies> </dependencies>
</metadata> </metadata>

1
build/NuSpecs/ImageProcessor.nuspec

@ -25,5 +25,6 @@ Feedback is always welcome.</description>
</metadata> </metadata>
<files> <files>
<file src="..\_BuildOutput\ImageProcessor\lib\ImageProcessor.dll" target="lib\ImageProcessor.dll" /> <file src="..\_BuildOutput\ImageProcessor\lib\ImageProcessor.dll" target="lib\ImageProcessor.dll" />
<file src="..\_BuildOutput\ImageProcessor\lib\libwebp.dll" target="lib\libwebp.dll" />
</files> </files>
</package> </package>

10
build/content/ImageProcessor.Web.Config/web.config.transform

@ -2,9 +2,9 @@
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="imageProcessor"> <sectionGroup name="imageProcessor">
<section name="security" requirePermission="false" type="ImageProcessor.Web.Config.ImageSecuritySection, ImageProcessor.Web" /> <section name="security" requirePermission="false" type="ImageProcessor.Web.Configuration.ImageSecuritySection, ImageProcessor.Web"/>
<section name="processing" requirePermission="false" type="ImageProcessor.Web.Config.ImageProcessingSection, ImageProcessor.Web" /> <section name="processing" requirePermission="false" type="ImageProcessor.Web.Configuration.ImageProcessingSection, ImageProcessor.Web"/>
<section name="cache" requirePermission="false" type="ImageProcessor.Web.Config.ImageCacheSection, ImageProcessor.Web" /> <section name="cache" requirePermission="false" type="ImageProcessor.Web.Configuration.ImageCacheSection, ImageProcessor.Web"/>
</sectionGroup> </sectionGroup>
</configSections> </configSections>
@ -13,8 +13,4 @@
<cache configSource="config\imageprocessor\cache.config" /> <cache configSource="config\imageprocessor\cache.config" />
<processing configSource="config\imageprocessor\processing.config" /> <processing configSource="config\imageprocessor\processing.config" />
</imageProcessor> </imageProcessor>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration> </configuration>

4
build/content/ImageProcessor.Web/web.config.transform

@ -7,6 +7,10 @@
</system.web> </system.web>
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false" /> <validation validateIntegratedModeConfiguration="false" />
<staticContent>
<remove fileExtension=".webp"/>
<mimeMap fileExtension=".webp" mimeType="image/webp" />
</staticContent>
<modules> <modules>
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/> <add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>
</modules> </modules>

3
src/ImageProcessor.Web/NET45/Caching/DiskCache.cs

@ -19,7 +19,8 @@ namespace ImageProcessor.Web.Caching
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web; using System.Web;
using System.Web.Hosting; using System.Web.Hosting;
using ImageProcessor.Core.Common.Extensions;
using ImageProcessor.Common.Extensions;
using ImageProcessor.Web.Configuration; using ImageProcessor.Web.Configuration;
using ImageProcessor.Web.Helpers; using ImageProcessor.Web.Helpers;
#endregion #endregion

2
src/ImageProcessor.Web/NET45/Configuration/ImageCacheSection.cs

@ -15,7 +15,7 @@ namespace ImageProcessor.Web.Configuration
using System.IO; using System.IO;
using System.Xml; using System.Xml;
using ImageProcessor.Core.Common.Extensions; using ImageProcessor.Common.Extensions;
using ImageProcessor.Web.Helpers; using ImageProcessor.Web.Helpers;
#endregion #endregion

3
src/ImageProcessor.Web/NET45/Configuration/Resources/processing.config

@ -4,12 +4,13 @@
<plugins autoLoadPlugins="true"> <plugins autoLoadPlugins="true">
<plugin name="Alpha" type="ImageProcessor.Web.Processors.Alpha, ImageProcessor.Web"/> <plugin name="Alpha" type="ImageProcessor.Web.Processors.Alpha, ImageProcessor.Web"/>
<plugin name="AutoRotate" type="ImageProcessor.Web.Processors.AutoRotate, ImageProcessor.Web"/> <plugin name="AutoRotate" type="ImageProcessor.Web.Processors.AutoRotate, ImageProcessor.Web"/>
<plugin name="BackgroundColor" type="ImageProcessor.Web.Processors.BackgroundColor, ImageProcessor.Web"/>
<plugin name="Brightness" type="ImageProcessor.Web.Processors.Brightness, ImageProcessor.Web"/> <plugin name="Brightness" type="ImageProcessor.Web.Processors.Brightness, ImageProcessor.Web"/>
<plugin name="Contrast" type="ImageProcessor.Web.Processors.Contrast, ImageProcessor.Web"/> <plugin name="Contrast" type="ImageProcessor.Web.Processors.Contrast, ImageProcessor.Web"/>
<plugin name="Crop" type="ImageProcessor.Web.Processors.Crop, ImageProcessor.Web"/> <plugin name="Crop" type="ImageProcessor.Web.Processors.Crop, ImageProcessor.Web"/>
<plugin name="Filter" type="ImageProcessor.Web.Processors.Filter, ImageProcessor.Web"/> <plugin name="Filter" type="ImageProcessor.Web.Processors.Filter, ImageProcessor.Web"/>
<plugin name="Flip" type="ImageProcessor.Web.Processors.Flip, ImageProcessor.Web"/> <plugin name="Flip" type="ImageProcessor.Web.Processors.Flip, ImageProcessor.Web"/>
<plugin name="Format" type="ImageProcessor.Web.Processors.Format, ImageProcessor.Web"/> <plugin name="Format" type="ImageProcessor.Web.Processors.Format, ImageProcessor.Web"/>
<plugin name="GaussianBlur" type="ImageProcessor.Web.Processors.GaussianBlur, ImageProcessor.Web"> <plugin name="GaussianBlur" type="ImageProcessor.Web.Processors.GaussianBlur, ImageProcessor.Web">
<settings> <settings>
<setting key="MaxSize" value="22"/> <setting key="MaxSize" value="22"/>

3
src/ImageProcessor.Web/NET45/Helpers/CommonParameterParserUtility.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Web.Helpers
using System.Drawing; using System.Drawing;
using System.Globalization; using System.Globalization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using ImageProcessor.Core.Common.Extensions;
using ImageProcessor.Common.Extensions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
/// <summary> /// <summary>

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

@ -29,7 +29,7 @@ namespace ImageProcessor.Web.HttpModules
using System.Web.Hosting; using System.Web.Hosting;
using System.Web.Security; using System.Web.Security;
using ImageProcessor.Core.Common.Extensions; using ImageProcessor.Common.Extensions;
using ImageProcessor.Web.Caching; using ImageProcessor.Web.Caching;
using ImageProcessor.Web.Configuration; using ImageProcessor.Web.Configuration;
using ImageProcessor.Web.Helpers; using ImageProcessor.Web.Helpers;

3
src/ImageProcessor.Web/NET45/Processors/Crop.cs

@ -12,7 +12,8 @@ namespace ImageProcessor.Web.Processors
{ {
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using ImageProcessor.Core.Common.Extensions;
using ImageProcessor.Common.Extensions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
using ImageProcessor.Processors; using ImageProcessor.Processors;

8
src/ImageProcessor.Web/NET45/Processors/Format.cs

@ -11,9 +11,12 @@
namespace ImageProcessor.Web.Processors namespace ImageProcessor.Web.Processors
{ {
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Web;
using ImageProcessor.Configuration; using ImageProcessor.Configuration;
using ImageProcessor.Imaging.Formats; using ImageProcessor.Imaging.Formats;
using ImageProcessor.Processors; using ImageProcessor.Processors;
@ -135,13 +138,14 @@ namespace ImageProcessor.Web.Processors
identifier = identifier.ToLowerInvariant(); identifier = identifier.ToLowerInvariant();
string finalIdentifier = identifier.Equals("png8") ? "png" : identifier; string finalIdentifier = identifier.Equals("png8") ? "png" : identifier;
ISupportedImageFormat newFormat = null; ISupportedImageFormat newFormat = null;
ISupportedImageFormat format = ImageProcessorBootstrapper.Instance.SupportedImageFormats List<ISupportedImageFormat> formats = ImageProcessorBootstrapper.Instance.SupportedImageFormats.ToList();
.FirstOrDefault(f => f.FileExtensions.Any(e => e.Equals(finalIdentifier, StringComparison.InvariantCultureIgnoreCase))); ISupportedImageFormat format = formats.FirstOrDefault(f => f.FileExtensions.Any(e => e.Equals(finalIdentifier, StringComparison.InvariantCultureIgnoreCase)));
if (format != null) if (format != null)
{ {
// Return a new instance as we want to use instance properties. // Return a new instance as we want to use instance properties.
newFormat = Activator.CreateInstance(format.GetType()) as ISupportedImageFormat; newFormat = Activator.CreateInstance(format.GetType()) as ISupportedImageFormat;
if (newFormat != null) if (newFormat != null)
{ {
// I wish this wasn't hard-coded but there's no way I can // I wish this wasn't hard-coded but there's no way I can

3
src/ImageProcessor.Web/NET45/Processors/Resize.cs

@ -16,7 +16,8 @@ namespace ImageProcessor.Web.Processors
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using ImageProcessor.Core.Common.Extensions;
using ImageProcessor.Common.Extensions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
using ImageProcessor.Processors; using ImageProcessor.Processors;

3
src/ImageProcessor.Web/NET45/Processors/Watermark.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Web.Processors
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using ImageProcessor.Core.Common.Extensions;
using ImageProcessor.Common.Extensions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
using ImageProcessor.Processors; using ImageProcessor.Processors;
using ImageProcessor.Web.Helpers; using ImageProcessor.Web.Helpers;

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

@ -35,5 +35,5 @@ using ImageProcessor.Web.HttpModules;
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("3.2.7.0")] [assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("3.2.7.0")] [assembly: AssemblyFileVersion("4.0.0.0")]

3
src/ImageProcessor/Core/Common/Exceptions/ImageFormatException.cs → src/ImageProcessor/Common/Exceptions/ImageFormatException.cs

@ -8,10 +8,9 @@
// </summary> // </summary>
// -------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Core.Common.Exceptions namespace ImageProcessor.Common.Exceptions
{ {
using System; using System;
using System.Runtime.Serialization;
/// <summary> /// <summary>
/// The exception that is thrown when loading the supported image format types has failed. /// The exception that is thrown when loading the supported image format types has failed.

2
src/ImageProcessor/Core/Common/Exceptions/ImageProcessingException.cs → src/ImageProcessor/Common/Exceptions/ImageProcessingException.cs

@ -8,7 +8,7 @@
// </summary> // </summary>
// -------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Core.Common.Exceptions namespace ImageProcessor.Common.Exceptions
{ {
using System; using System;

2
src/ImageProcessor/Core/Common/Extensions/DoubleExtensions.cs → src/ImageProcessor/Common/Extensions/DoubleExtensions.cs

@ -8,7 +8,7 @@
// </summary> // </summary>
// -------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Core.Common.Extensions namespace ImageProcessor.Common.Extensions
{ {
/// <summary> /// <summary>
/// Encapsulates a series of time saving extension methods to the <see cref="T:System.Double"/> class. /// Encapsulates a series of time saving extension methods to the <see cref="T:System.Double"/> class.

2
src/ImageProcessor/Core/Common/Extensions/IntegerExtensions.cs → src/ImageProcessor/Common/Extensions/IntegerExtensions.cs

@ -8,7 +8,7 @@
// </summary> // </summary>
// -------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Core.Common.Extensions namespace ImageProcessor.Common.Extensions
{ {
using System.Globalization; using System.Globalization;

6
src/ImageProcessor/Core/Common/Extensions/StringExtensions.cs → src/ImageProcessor/Common/Extensions/StringExtensions.cs

@ -8,10 +8,8 @@
// </summary> // </summary>
// -------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Core.Common.Extensions namespace ImageProcessor.Common.Extensions
{ {
#region Using
using System; using System;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
@ -19,8 +17,6 @@ namespace ImageProcessor.Core.Common.Extensions
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
#endregion
/// <summary> /// <summary>
/// Encapsulates a series of time saving extension methods to the <see cref="T:System.String"/> class. /// Encapsulates a series of time saving extension methods to the <see cref="T:System.String"/> class.
/// </summary> /// </summary>

3
src/ImageProcessor/Configuration/ImageProcessorBootstrapper.cs

@ -13,7 +13,8 @@ namespace ImageProcessor.Configuration
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging.Formats; using ImageProcessor.Imaging.Formats;
/// <summary> /// <summary>

3
src/ImageProcessor/ImageFactory.cs

@ -17,7 +17,8 @@ namespace ImageProcessor
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
using ImageProcessor.Imaging.Filters; using ImageProcessor.Imaging.Filters;
using ImageProcessor.Imaging.Formats; using ImageProcessor.Imaging.Formats;

10
src/ImageProcessor/ImageProcessor.csproj

@ -60,12 +60,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Configuration\ImageProcessorBootstrapper.cs" /> <Compile Include="Configuration\ImageProcessorBootstrapper.cs" />
<Compile Include="Core\Common\Exceptions\ImageProcessingException.cs" /> <Compile Include="Common\Exceptions\ImageProcessingException.cs" />
<Compile Include="Core\Common\Extensions\DoubleExtensions.cs" /> <Compile Include="Common\Extensions\DoubleExtensions.cs" />
<Compile Include="Imaging\Formats\GifInfo.cs" /> <Compile Include="Imaging\Formats\GifInfo.cs" />
<Compile Include="Core\Common\Extensions\IntegerExtensions.cs" /> <Compile Include="Common\Extensions\IntegerExtensions.cs" />
<Compile Include="Core\Common\Extensions\StringExtensions.cs" /> <Compile Include="Common\Extensions\StringExtensions.cs" />
<Compile Include="Core\Common\Exceptions\ImageFormatException.cs" /> <Compile Include="Common\Exceptions\ImageFormatException.cs" />
<Compile Include="ImageFactory.cs" /> <Compile Include="ImageFactory.cs" />
<Compile Include="Imaging\AnchorPosition.cs" /> <Compile Include="Imaging\AnchorPosition.cs" />
<Compile Include="Imaging\ExifPropertyTagType.cs" /> <Compile Include="Imaging\ExifPropertyTagType.cs" />

2
src/ImageProcessor/Imaging/Convolution.cs

@ -15,7 +15,7 @@ namespace ImageProcessor.Imaging
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using ImageProcessor.Core.Common.Extensions; using ImageProcessor.Common.Extensions;
/// <summary> /// <summary>
/// Provides methods for applying blurring and sharpening effects to an image.. /// Provides methods for applying blurring and sharpening effects to an image..

4
src/ImageProcessor/Imaging/Filters/ComicMatrixFilter.cs

@ -17,7 +17,9 @@ namespace ImageProcessor.Imaging.Filters
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using ImageProcessor.Core.Common.Extensions;
using ImageProcessor.Common.Extensions;
#endregion #endregion
/// <summary> /// <summary>

85
src/ImageProcessor/Imaging/Formats/WebPFormat.cs

@ -21,7 +21,7 @@ namespace ImageProcessor.Imaging.Formats
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using ImageProcessor.Core.Common.Exceptions; using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Provides the necessary information to support webp images. /// Provides the necessary information to support webp images.
@ -163,6 +163,10 @@ namespace ImageProcessor.Imaging.Formats
memoryStream.Position = stream.Position = 0; memoryStream.Position = stream.Position = 0;
} }
} }
else
{
throw new ImageFormatException("Unable to encode WebP image.");
}
return image; return image;
} }
@ -183,36 +187,52 @@ namespace ImageProcessor.Imaging.Formats
IntPtr ptrData = pinnedWebP.AddrOfPinnedObject(); IntPtr ptrData = pinnedWebP.AddrOfPinnedObject();
uint dataSize = (uint)webpData.Length; uint dataSize = (uint)webpData.Length;
Bitmap bitmap = null;
BitmapData bitmapData = null;
IntPtr outputBuffer = IntPtr.Zero;
int width; int width;
int height; int height;
if (WebPGetInfo(ptrData, dataSize, out width, out height) != 1) if (WebPGetInfo(ptrData, dataSize, out width, out height) != 1)
{ {
throw new ImageFormatException("WebP image is corrupted."); throw new ImageFormatException("WebP image header is corrupted.");
} }
// Create a BitmapData and Lock all pixels to be written try
Bitmap bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); {
BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.WriteOnly, bitmap.PixelFormat); // Create a BitmapData and Lock all pixels to be written
bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb);
bitmapData = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.WriteOnly, bitmap.PixelFormat);
// Allocate memory for uncompress image // Allocate memory for uncompress image
int outputBufferSize = bitmapData.Stride * height; int outputBufferSize = bitmapData.Stride * height;
IntPtr outputBuffer = Marshal.AllocHGlobal(outputBufferSize); outputBuffer = Marshal.AllocHGlobal(outputBufferSize);
// Uncompress the image // Uncompress the image
outputBuffer = WebPDecodeBGRAInto(ptrData, dataSize, outputBuffer, outputBufferSize, bitmapData.Stride); outputBuffer = WebPDecodeBGRAInto(ptrData, dataSize, outputBuffer, outputBufferSize, bitmapData.Stride);
// Write image to bitmap using Marshal if (bitmapData.Scan0 != outputBuffer)
byte[] buffer = new byte[outputBufferSize]; {
Marshal.Copy(outputBuffer, buffer, 0, outputBufferSize); throw new ImageFormatException("Failed to decode WebP image with error " + (long)outputBuffer);
Marshal.Copy(buffer, 0, bitmapData.Scan0, outputBufferSize); }
// Unlock the pixels // Write image to bitmap using Marshal
bitmap.UnlockBits(bitmapData); byte[] buffer = new byte[outputBufferSize];
Marshal.Copy(outputBuffer, buffer, 0, outputBufferSize);
Marshal.Copy(buffer, 0, bitmapData.Scan0, outputBufferSize);
}
finally
{
// Unlock the pixels
if (bitmap != null)
{
bitmap.UnlockBits(bitmapData);
}
// Free memory // Free memory
pinnedWebP.Free(); pinnedWebP.Free();
Marshal.FreeHGlobal(outputBuffer); Marshal.FreeHGlobal(outputBuffer);
}
return bitmap; return bitmap;
} }
@ -235,29 +255,34 @@ namespace ImageProcessor.Imaging.Formats
private static bool EncodeLossly(Bitmap bitmap, int quality, out byte[] webpData) private static bool EncodeLossly(Bitmap bitmap, int quality, out byte[] webpData)
{ {
webpData = null; webpData = null;
BitmapData bmpData = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
IntPtr unmanagedData = IntPtr.Zero;
bool encoded;
try try
{ {
BitmapData bmpData = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); // Attempt to lossy encode the image.
IntPtr unmanagedData;
int size = WebPEncodeBGRA(bmpData.Scan0, bitmap.Width, bitmap.Height, bmpData.Stride, quality, out unmanagedData); int size = WebPEncodeBGRA(bmpData.Scan0, bitmap.Width, bitmap.Height, bmpData.Stride, quality, out unmanagedData);
// Copy image compress data to output array // Copy image compress data to output array
webpData = new byte[size]; webpData = new byte[size];
Marshal.Copy(unmanagedData, webpData, 0, size); Marshal.Copy(unmanagedData, webpData, 0, size);
encoded = true;
}
catch
{
encoded = false;
}
finally
{
// Unlock the pixels // Unlock the pixels
bitmap.UnlockBits(bmpData); bitmap.UnlockBits(bmpData);
// Free memory // Free memory
WebPFree(unmanagedData); WebPFree(unmanagedData);
return true;
}
catch
{
return false;
} }
return encoded;
} }
/// <summary> /// <summary>
@ -335,13 +360,13 @@ namespace ImageProcessor.Imaging.Formats
/// <summary> /// <summary>
/// Frees the unmanaged memory. /// Frees the unmanaged memory.
/// </summary> /// </summary>
/// <param name="p"> /// <param name="pointer">
/// The pointer. /// The pointer.
/// </param> /// </param>
/// <returns> /// <returns>
/// 1 if success, otherwise error code returned in the case of (a) error(s). /// 1 if success, otherwise error code returned in the case of (a) error(s).
/// </returns> /// </returns>
[DllImport("libwebp.dll", CallingConvention = CallingConvention.Cdecl)] [DllImport("libwebp.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int WebPFree(IntPtr p); private static extern int WebPFree(IntPtr pointer);
} }
} }

3
src/ImageProcessor/Processors/Alpha.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Encapsulates methods to change the alpha component of the image to effect its transparency. /// Encapsulates methods to change the alpha component of the image to effect its transparency.

3
src/ImageProcessor/Processors/AutoRotate.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
/// <summary> /// <summary>

3
src/ImageProcessor/Processors/BackgroundColor.cs

@ -13,7 +13,8 @@ namespace ImageProcessor.Processors
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Changes the background color of an image. /// Changes the background color of an image.

3
src/ImageProcessor/Processors/Brightness.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Encapsulates methods to change the brightness component of the image. /// Encapsulates methods to change the brightness component of the image.

3
src/ImageProcessor/Processors/Contrast.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Encapsulates methods to change the contrast component of the image. /// Encapsulates methods to change the contrast component of the image.

3
src/ImageProcessor/Processors/Crop.cs

@ -15,7 +15,8 @@ namespace ImageProcessor.Processors
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
/// <summary> /// <summary>

3
src/ImageProcessor/Processors/Filter.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging.Filters; using ImageProcessor.Imaging.Filters;
/// <summary> /// <summary>

3
src/ImageProcessor/Processors/Flip.cs

@ -13,7 +13,8 @@ namespace ImageProcessor.Processors
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Flips an image horizontally or vertically. /// Flips an image horizontally or vertically.

3
src/ImageProcessor/Processors/Format.cs

@ -13,7 +13,8 @@ namespace ImageProcessor.Processors
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging.Formats; using ImageProcessor.Imaging.Formats;
/// <summary> /// <summary>

3
src/ImageProcessor/Processors/GaussianBlur.cs

@ -13,7 +13,8 @@ namespace ImageProcessor.Processors
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
/// <summary> /// <summary>

3
src/ImageProcessor/Processors/GaussianSharpen.cs

@ -13,7 +13,8 @@ namespace ImageProcessor.Processors
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
/// <summary> /// <summary>

3
src/ImageProcessor/Processors/Quality.cs

@ -13,7 +13,8 @@ namespace ImageProcessor.Processors
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Encapsulates methods to change the quality component of the image. /// Encapsulates methods to change the quality component of the image.

3
src/ImageProcessor/Processors/Resize.cs

@ -17,7 +17,8 @@ namespace ImageProcessor.Processors
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
/// <summary> /// <summary>

3
src/ImageProcessor/Processors/Rotate.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Encapsulates methods to rotate an image. /// Encapsulates methods to rotate an image.

3
src/ImageProcessor/Processors/RoundedCorners.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
/// <summary> /// <summary>

3
src/ImageProcessor/Processors/Saturation.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Encapsulates methods to change the saturation component of the image. /// Encapsulates methods to change the saturation component of the image.

3
src/ImageProcessor/Processors/Tint.cs

@ -15,7 +15,8 @@ namespace ImageProcessor.Processors
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Tints an image with the given color. /// Tints an image with the given color.

3
src/ImageProcessor/Processors/Vignette.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
/// <summary> /// <summary>
/// Encapsulates methods with which to add a vignette image effect to an image. /// Encapsulates methods with which to add a vignette image effect to an image.

3
src/ImageProcessor/Processors/Watermark.cs

@ -14,7 +14,8 @@ namespace ImageProcessor.Processors
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Text; using System.Drawing.Text;
using ImageProcessor.Core.Common.Exceptions;
using ImageProcessor.Common.Exceptions;
using ImageProcessor.Imaging; using ImageProcessor.Imaging;
/// <summary> /// <summary>

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 // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("1.9.3.0")] [assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("1.9.3.0")] [assembly: AssemblyFileVersion("2.0.0.0")]

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

@ -4,41 +4,42 @@
<!--<preset name="demo" value="width=300&#038;height=150&#038;bgcolor=transparent"/>--> <!--<preset name="demo" value="width=300&#038;height=150&#038;bgcolor=transparent"/>-->
</presets> </presets>
<plugins autoLoadPlugins="true"> <plugins autoLoadPlugins="true">
<plugin name="Alpha" type="ImageProcessor.Processors.Alpha, ImageProcessor"/> <plugin name="Alpha" type="ImageProcessor.Web.Processors.Alpha, ImageProcessor.Web"/>
<plugin name="AutoRotate" type="ImageProcessor.Processors.AutoRotate, ImageProcessor"/> <plugin name="AutoRotate" type="ImageProcessor.Web.Processors.AutoRotate, ImageProcessor.Web"/>
<plugin name="Brightness" type="ImageProcessor.Processors.Brightness, ImageProcessor"/> <plugin name="BackgroundColor" type="ImageProcessor.Web.Processors.BackgroundColor, ImageProcessor.Web"/>
<plugin name="Contrast" type="ImageProcessor.Processors.Contrast, ImageProcessor"/> <plugin name="Brightness" type="ImageProcessor.Web.Processors.Brightness, ImageProcessor.Web"/>
<plugin name="Crop" type="ImageProcessor.Processors.Crop, ImageProcessor"/> <plugin name="Contrast" type="ImageProcessor.Web.Processors.Contrast, ImageProcessor.Web"/>
<plugin name="Filter" type="ImageProcessor.Processors.Filter, ImageProcessor"/> <plugin name="Crop" type="ImageProcessor.Web.Processors.Crop, ImageProcessor.Web"/>
<plugin name="Flip" type="ImageProcessor.Processors.Flip, ImageProcessor"/> <plugin name="Filter" type="ImageProcessor.Web.Processors.Filter, ImageProcessor.Web"/>
<plugin name="Format" type="ImageProcessor.Processors.Format, ImageProcessor"/> <plugin name="Flip" type="ImageProcessor.Web.Processors.Flip, ImageProcessor.Web"/>
<plugin name="GaussianBlur" type="ImageProcessor.Processors.GaussianBlur, ImageProcessor"> <plugin name="Format" type="ImageProcessor.Web.Processors.Format, ImageProcessor.Web"/>
<plugin name="GaussianBlur" type="ImageProcessor.Web.Processors.GaussianBlur, ImageProcessor.Web">
<settings> <settings>
<setting key="MaxSize" value="22"/> <setting key="MaxSize" value="22"/>
<setting key="MaxSigma" value="5.1"/> <setting key="MaxSigma" value="5.1"/>
<setting key="MaxThreshold" value="100"/> <setting key="MaxThreshold" value="100"/>
</settings> </settings>
</plugin> </plugin>
<plugin name="GaussianSharpen" type="ImageProcessor.Processors.GaussianSharpen, ImageProcessor"> <plugin name="GaussianSharpen" type="ImageProcessor.Web.Processors.GaussianSharpen, ImageProcessor.Web">
<settings> <settings>
<setting key="MaxSize" value="22"/> <setting key="MaxSize" value="22"/>
<setting key="MaxSigma" value="5.1"/> <setting key="MaxSigma" value="5.1"/>
<setting key="MaxThreshold" value="100"/> <setting key="MaxThreshold" value="100"/>
</settings> </settings>
</plugin> </plugin>
<plugin name="Quality" type="ImageProcessor.Processors.Quality, ImageProcessor"/> <plugin name="Quality" type="ImageProcessor.Web.Processors.Quality, ImageProcessor.Web"/>
<plugin name="Resize" type="ImageProcessor.Processors.Resize, ImageProcessor"> <plugin name="Resize" type="ImageProcessor.Web.Processors.Resize, ImageProcessor.Web">
<settings> <settings>
<setting key="MaxWidth" value="3000"/> <setting key="MaxWidth" value="5000"/>
<setting key="MaxHeight" value="3000"/> <setting key="MaxHeight" value="5000"/>
<!--<setting key="RestrictTo" value="width=300height=300,width=300height=300"/>-->
</settings> </settings>
</plugin> </plugin>
<plugin name="Rotate" type="ImageProcessor.Processors.Rotate, ImageProcessor"/> <plugin name="Rotate" type="ImageProcessor.Web.Processors.Rotate, ImageProcessor.Web"/>
<plugin name="RoundedCorners" type="ImageProcessor.Processors.RoundedCorners, ImageProcessor"/> <plugin name="RoundedCorners" type="ImageProcessor.Web.Processors.RoundedCorners, ImageProcessor.Web"/>
<plugin name="Saturation" type="ImageProcessor.Processors.Saturation, ImageProcessor"/> <plugin name="Saturation" type="ImageProcessor.Web.Processors.Saturation, ImageProcessor.Web"/>
<plugin name="Vignette" type="ImageProcessor.Processors.Vignette, ImageProcessor"/> <plugin name="Tint" type="ImageProcessor.Web.Processors.Tint, ImageProcessor.Web"/>
<plugin name="Watermark" type="ImageProcessor.Processors.Watermark, ImageProcessor"/> <plugin name="Vignette" type="ImageProcessor.Web.Processors.Vignette, ImageProcessor.Web"/>
<plugin name="Watermark" type="ImageProcessor.Web.Processors.Watermark, ImageProcessor.Web"/>
</plugins> </plugins>
</processing> </processing>

2
src/TestWebsites/NET45/Test_Website_NET45/Views/Web.config

@ -45,11 +45,11 @@
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" /> <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls> </controls>
</pages> </pages>
</system.web> </system.web>
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false" /> <validation validateIntegratedModeConfiguration="false" />
<handlers> <handlers>
<remove name="BlockViewHandler"/> <remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /> <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />

5
src/TestWebsites/NET45/Test_Website_NET45/Web.config

@ -44,10 +44,15 @@
<httpModules> <httpModules>
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/> <add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>
</httpModules> </httpModules>
</system.web> </system.web>
<system.webServer> <system.webServer>
<validation validateIntegratedModeConfiguration="false"/> <validation validateIntegratedModeConfiguration="false"/>
<staticContent>
<remove fileExtension=".webp"/>
<mimeMap fileExtension=".webp" mimeType="image/webp" />
</staticContent>
<handlers> <handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />

2
src/TestWebsites/NET45/Test_Website_NET45/config/imageprocessor/processing.config

@ -3,6 +3,8 @@
</presets> </presets>
<plugins autoLoadPlugins="true"> <plugins autoLoadPlugins="true">
<plugin name="Alpha" type="ImageProcessor.Web.Processors.Alpha, ImageProcessor.Web"/> <plugin name="Alpha" type="ImageProcessor.Web.Processors.Alpha, ImageProcessor.Web"/>
<plugin name="AutoRotate" type="ImageProcessor.Web.Processors.AutoRotate, ImageProcessor.Web"/>
<plugin name="BackgroundColor" type="ImageProcessor.Web.Processors.BackgroundColor, ImageProcessor.Web"/>
<plugin name="Brightness" type="ImageProcessor.Web.Processors.Brightness, ImageProcessor.Web"/> <plugin name="Brightness" type="ImageProcessor.Web.Processors.Brightness, ImageProcessor.Web"/>
<plugin name="Contrast" type="ImageProcessor.Web.Processors.Contrast, ImageProcessor.Web"/> <plugin name="Contrast" type="ImageProcessor.Web.Processors.Contrast, ImageProcessor.Web"/>
<plugin name="Crop" type="ImageProcessor.Web.Processors.Crop, ImageProcessor.Web"/> <plugin name="Crop" type="ImageProcessor.Web.Processors.Crop, ImageProcessor.Web"/>

4
src/TestWebsites/NET45/Test_Website_NET45/config/imageprocessor/security.config

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

Loading…
Cancel
Save