Browse Source

V1.3.0

Fixed concurrency bug
Fixed Rotate regex bug
Changed the Resize method to accept a System.Drawing.Size
Changed the Rotate method to accept an
ImageProcessor.Imaging.RotateLayer
Reoganized project.


Former-commit-id: 0dc963f74c9f8a7c1967ca328fa70a9e4ad40a0f
af/merge-core
James South 13 years ago
parent
commit
13931014e9
  1. 64
      README.md
  2. 35
      src/ImageProcessor.Web/HttpModules/ImageProcessingModule.cs
  3. 42
      src/ImageProcessor.Web/ImageFactoryExtensions.cs
  4. 96
      src/ImageProcessor.Web/ImageProcessor.Web.vsdoc
  5. 6
      src/ImageProcessor.Web/Properties/AssemblyInfo.cs
  6. 8
      src/ImageProcessor.sln
  7. 5
      src/ImageProcessor/ImageFactory.cs
  8. 7
      src/ImageProcessor/ImageProcessor.sln.vsdoc
  9. 105
      src/ImageProcessor/ImageProcessor.vsdoc
  10. 2
      src/ImageProcessor/Processors/Rotate.cs
  11. 6
      src/ImageProcessor/Properties/AssemblyInfo.cs
  12. 1
      src/ImageProcessor/UpgradeLog.htm.REMOVED.git-id
  13. 20
      src/Test/Test.sln
  14. 22
      src/Test/Test/Content/style.css
  15. 3
      src/Test/Test/Test.csproj
  16. 137
      src/Test/Test/Views/Home/Index.cshtml
  17. 19
      src/Test/Test/Views/Shared/_Layout.cshtml
  18. 204
      src/Test/Test/Web.config
  19. 4
      src/Test/Test/packages.config

64
README.md

@ -1,20 +1,21 @@
ImageProcessor
===============
ImageProcessor is a library for on the fly processing of image files using Asp.Net 4 written in c#.
Imageprocessor is a lightweight library written in C# that allows you to manipulate images on-the-fly using ASP.NET 4.0.
The library architecture is highly extensible and allows for easy extension.
It's fast, extensible, easy to use, comes bundled with some great features and is fully open source.
Core plugins at present include:
- Resize
- Crop
- Quality (The quality to set the output for jpeg files)
- Filter (Image filters including sepia, greyscale, blackwhite, lomograph, comic)
- Vignette (Adds a vignette effect to images)
- Format (Sets the output format)
- Alpha (Sets opacity)
- Filter (Image filters including sepia, greyscale, blackwhite, lomograph, polaroid, comic, gotham, hisatch, losatch)
- Watermark (Set a text watermark)
- Format (Sets the output format)
- Rotate (Rotate the image)
- Quality (The quality to set the output for jpeg files)
- Vignette (Adds a vignette effect to images)
The library consists of two binaries: **ImageProcessor.dll** and **ImageProcessor.Web.dll**.
@ -24,9 +25,9 @@ e.g.
// Read a file and resize it.
byte[] photoBytes = File.ReadAllBytes(file);
int quality = 90;
int quality = 70;
ImageFormat format = ImageFormat.Jpeg;
int thumbnailSize = 150;
Size size = new Size(150, 0)
using (var inStream = new MemoryStream(photoBytes))
{
@ -34,9 +35,15 @@ e.g.
{
using (ImageFactory imageFactory = new ImageFactory())
{
// Load, resize and save an image.
imageFactory.Load(inStream).Format(format).Quality(quality).Resize(thumbnailSize, 0).Save(outStream);
// Load, resize, set the format and quality and save an image.
imageFactory.Load(inStream)
.Resize(size)
.Format(format)
.Quality(quality)
.Save(outStream);
}
// Do something with the stream.
}
}
@ -44,14 +51,18 @@ e.g.
Using the HttpModule requires no code writing at all. Just reference the binaries and add the relevant sections to the web.config
Image requests suffixed with QueryString parameters will then be processed and cached to the server allowing for easy and efficient parsing of following requests.
Image requests suffixed with querystring parameters will then be processed and cached to the server allowing for easy and efficient parsing of following requests.
The parsing engine for the HttpModule is incredibly flexible and will **allow you to add querystring parameters in any order.**
Installation
============
Installation is simple. Download the zip file from the downloads section and copy the two binaries into your bin folder. Then copy the example configuration values from the `config.txt` into your `web.config` to enable the processor. A Nuget package will be created once I've read the manual to allow simpler installation in the future.
Installation is simple. A Nuget package is available [here][1].
[1]: http://nuget.org/packages/ImageProcessor/
Alternatively you can download and build the project and reference the binaries. Then copy the example configuration values from the demo project into your `web.config` to enable the processor.
Usage
=====
@ -144,10 +155,37 @@ Supported file format just now are:
- jpg
- bmp
- png
- gif
- gif (requires full trust)
e.g.
<img src="/images.yourimage.jpg?format=gif" alt="your image as a gif"/>
Rotate
======
Imageprocessor can rotate your images without clipping. You can also optionally fill the background color for image types without transparency.
e.g.
<img src="/images.yourimage.jpg?rotate=26" alt="your image rotated"/>
<img src="/images.yourimage.jpg?rotate=angle-54|bgcolor-fff" alt="your image rotated"/>
Quality
======
Whilst Imageprocessor delivers an excellent quality/filesize ratio it also allows you to change the quality of jpegs on-the-fly.
e.g.
<img src="/images.yourimage.jpg?quality=65" alt="your image at quality 30"/>
Vignette
======
Imageprocessor can also add a vignette effect to images.
e.g.
<img src="/images.yourimage.jpg?vignette=true" alt="your image vignetted"/>

35
src/ImageProcessor.Web/HttpModules/ImageProcessingModule.cs

@ -123,40 +123,35 @@ namespace ImageProcessor.Web.HttpModules
}
// Process the image.
if (isRemote)
using (ImageFactory imageFactory = new ImageFactory())
{
Uri uri = new Uri(path);
RemoteFile remoteFile = new RemoteFile(uri, false);
using (MemoryStream memoryStream = new MemoryStream())
if (isRemote)
{
using (Stream responseStream = remoteFile.GetWebResponse().GetResponseStream())
Uri uri = new Uri(path);
RemoteFile remoteFile = new RemoteFile(uri, false);
using (MemoryStream memoryStream = new MemoryStream())
{
if (responseStream != null)
using (Stream responseStream = remoteFile.GetWebResponse().GetResponseStream())
{
responseStream.CopyTo(memoryStream);
// Process the image.
using (ImageFactory imageFactory = new ImageFactory())
if (responseStream != null)
{
responseStream.CopyTo(memoryStream);
imageFactory.Load(memoryStream)
.AddQueryString(queryString)
.Format(ImageUtils.GetImageFormat(imageName))
.AutoProcess()
.Save(cachedPath);
.AddQueryString(queryString)
.Format(ImageUtils.GetImageFormat(imageName))
.AutoProcess().Save(cachedPath);
}
}
}
}
}
else
{
using (ImageFactory imageFactory = new ImageFactory())
else
{
imageFactory.Load(fullPath).AutoProcess().Save(cachedPath);
}
}
// Add 1 to the counter
cachedImageCounter += 1;
@ -255,4 +250,4 @@ namespace ImageProcessor.Web.HttpModules
}
#endregion
}
}
}

42
src/ImageProcessor.Web/ImageFactoryExtensions.cs

@ -24,6 +24,8 @@ namespace ImageProcessor.Web
/// </summary>
public static class ImageFactoryExtensions
{
private static readonly object SyncLock = new object();
/// <summary>
/// Auto processes image files based on any querystring parameters added to the image path.
/// </summary>
@ -38,42 +40,26 @@ namespace ImageProcessor.Web
{
if (factory.ShouldProcess)
{
// Get a list of all graphics processors that have parsed and matched the querystring.
List<IGraphicsProcessor> list =
ImageProcessorConfig.Instance.GraphicsProcessors
.Where(x => x.MatchRegexIndex(factory.QueryString) != int.MaxValue)
.OrderBy(y => y.SortOrder)
.ToList();
// Loop through and process the image.
foreach (IGraphicsProcessor graphicsProcessor in list)
// TODO: This is going to be a bottleneck for speed. Find a faster way.
lock (SyncLock)
{
try
{
// TODO: This is going to be a bottleneck for speed. Find a faster way.
IGraphicsProcessor processor =
(IGraphicsProcessor)Activator.CreateInstance(graphicsProcessor.GetType());
// Get the dynamic parameter.
processor.MatchRegexIndex(factory.QueryString);
// Process.
factory.Image = processor.ProcessImage(factory);
// Get a list of all graphics processors that have parsed and matched the querystring.
List<IGraphicsProcessor> list =
ImageProcessorConfig.Instance.GraphicsProcessors
.Where(x => x.MatchRegexIndex(factory.QueryString) != int.MaxValue)
.OrderBy(y => y.SortOrder)
.ToList();
//// TODO: This is going to be a bottleneck for speed. Find a faster way.
//IGraphicsProcessor processor =
// (IGraphicsProcessor)Activator.CreateInstance(graphicsProcessor.GetType());
//// Get the dynamic parameter.
//processor.MatchRegexIndex(factory.QueryString);
//// Process.
//factory.Image = processor.ProcessImage(factory);
}
catch (Exception ex)
// Loop through and process the image.
foreach (IGraphicsProcessor graphicsProcessor in list)
{
throw ex;
factory.Image = graphicsProcessor.ProcessImage(factory);
}
}
}
return factory;
}

96
src/ImageProcessor.Web/ImageProcessor.Web.vsdoc

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- VSdocman config file for current project/solution.-->
<activeProfile>default</activeProfile>
<appSettings>
<add key="VBdocman_regexFilters"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<filters />]]></add>
<add key="VBdocman_comNonCommented"><![CDATA[-1]]></add>
<add key="VBdocman_comPublic"><![CDATA[-1]]></add>
<add key="VBdocman_comPrivate"><![CDATA[0]]></add>
<add key="VBdocman_comFriend"><![CDATA[0]]></add>
<add key="VBdocman_comProtected"><![CDATA[0]]></add>
<add key="VBdocman_comProtectedFriend"><![CDATA[0]]></add>
<add key="VBdocman_comMethod"><![CDATA[-1]]></add>
<add key="VBdocman_comStdModule"><![CDATA[0]]></add>
<add key="VBdocman_comObject"><![CDATA[-1]]></add>
<add key="VBdocman_comForm"><![CDATA[-1]]></add>
<add key="VBdocman_comProperty"><![CDATA[-1]]></add>
<add key="VBdocman_comEvent"><![CDATA[-1]]></add>
<add key="VBdocman_comVariable"><![CDATA[0]]></add>
<add key="VBdocman_comConstant"><![CDATA[0]]></add>
<add key="VBdocman_comEnumeration"><![CDATA[0]]></add>
<add key="VBdocman_comStructure"><![CDATA[0]]></add>
<add key="VBdocman_comDelegate"><![CDATA[0]]></add>
<add key="VBdocman_comInterface"><![CDATA[0]]></add>
<add key="VBdocman_comAttribute"><![CDATA[0]]></add>
<add key="VBdocman_comEventDecl"><![CDATA[0]]></add>
<add key="VBdocman_comDeclare"><![CDATA[0]]></add>
<add key="VBdocman_comContextID"><![CDATA[0]]></add>
<add key="VBdocman_comWriteDescription"><![CDATA[-1]]></add>
<add key="VBdocman_useConditionalCompilation"><![CDATA[0]]></add>
<add key="VBdocman_conditionalConstants"><![CDATA[]]></add>
<add key="VBdocman_showFormsSeparate"><![CDATA[0]]></add>
<add key="VBdocman_showInherited"><![CDATA[-1]]></add>
<add key="VBdocman_indentMode"><![CDATA[0]]></add>
<add key="VBdocman_insertSourceGlobal"><![CDATA[0]]></add>
<add key="VBdocman_unbreakSourceLines"><![CDATA[0]]></add>
<add key="VBdocman_removeAttributes"><![CDATA[0]]></add>
<add key="VBdocman_generateVbSyntax"><![CDATA[-1]]></add>
<add key="VBdocman_generateCsharpSyntax"><![CDATA[-1]]></add>
<add key="VBdocman_generateCppSyntax"><![CDATA[-1]]></add>
<add key="VBdocman_generateJscriptSyntax"><![CDATA[-1]]></add>
<add key="VBdocman_supportedPlatforms"><![CDATA[Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition]]></add>
<add key="VBdocman_supportedNetFramework"><![CDATA[3.0, 2.0, 1.1, 1.0]]></add>
<add key="VBdocman_supportedNetCompactFramework"><![CDATA[2.0, 1.0]]></add>
<add key="VBdocman_supportedXnaFramework"><![CDATA[1.0]]></add>
<add key="VBdocman_customVar1"><![CDATA[]]></add>
<add key="VBdocman_customVar2"><![CDATA[]]></add>
<add key="VBdocman_customVar3"><![CDATA[]]></add>
<add key="VBdocman_titlePageText"><![CDATA[]]></add>
<add key="VBdocman_rootNamespaceText"><![CDATA[]]></add>
<add key="VBdocman_rootNamespaceCommentStyle"><![CDATA[2]]></add>
<add key="VBdocman_pageFooterText"><![CDATA[Generated by VSdocman]]></add>
<add key="VBdocman_outputPath"><![CDATA[$(ProjectDir)VSdoc]]></add>
<add key="VBdocman_templateFolder"><![CDATA[$(VSdocmanDir)Templates]]></add>
<add key="VBdocman_externalFilesFolder"><![CDATA[]]></add>
<add key="VBdocman_fileNamingConvention"><![CDATA[1]]></add>
<add key="VBdocman_templateLocale"><![CDATA[en-US]]></add>
<add key="VBdocman_templatePath"><![CDATA[chm_msdn2.vbdt]]></add>
<add key="VBdocman_enumSorting"><![CDATA[1]]></add>
<add key="VBdocman_helpTitle"><![CDATA[ImageProcessor.Web Reference]]></add>
<add key="VBdocman_customTopics"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<topics>
<topic>
<type>normal</type>
<is-default>yes</is-default>
<name>ImageProcessor.Web Reference</name>
<id>imageprocessorweb_reference</id>
<comment><![CDATA[<summary></summary>vsdocman_escaped_]_]_></comment>
<namespaces />
<topics>
<topic>
<type>placeholder</type>
<is-default>no</is-default>
<name />
<id>d85a6fde0cd5454f9dc418dda28f5422</id>
<comment><![CDATA[vsdocman_escaped_]_]_></comment>
<namespaces />
<topics />
</topic>
</topics>
</topic>
</topics>]]></add>
<add key="VBdocman_linkForExternalNotInFramework"><![CDATA[0]]></add>
<add key="VBdocman_allowMacrosInComments"><![CDATA[0]]></add>
<add key="VBdocman_emptyOutputFolder"><![CDATA[0]]></add>
<add key="VBdocman_comModules_Caching...DiskCache.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Config...ImageCacheSection.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Config...ImageProcessingSection.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Config...ImageProcessorConfig.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Config...ImageSecuritySection.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Helpers...RemoteFile.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_HttpModules...ImageProcessingModule.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Properties...AssemblyInfo.cs"><![CDATA[On]]></add>
</appSettings>
</configuration>

6
src/ImageProcessor.Web/Properties/AssemblyInfo.cs

@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("James South")]
[assembly: AssemblyCompany("James South")]
[assembly: AssemblyProduct("ImageProcessor.Web")]
[assembly: AssemblyCopyright("Copyright ©")]
[assembly: AssemblyCopyright("Copyright © James South")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

8
src/ImageProcessor/ImageProcessor.sln → src/ImageProcessor.sln

@ -1,11 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor", "ImageProcessor.csproj", "{3B5DD734-FB7A-487D-8CE6-55E7AF9AEA7E}"
# Visual Studio Express 2012 for Web
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor", "ImageProcessor\ImageProcessor.csproj", "{3B5DD734-FB7A-487D-8CE6-55E7AF9AEA7E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "..\Test\Test\Test.csproj", "{30327C08-7574-4D7E-AC95-6A58753C6855}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test\Test.csproj", "{30327C08-7574-4D7E-AC95-6A58753C6855}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor.Web", "..\ImageProcessor.Web\ImageProcessor.Web.csproj", "{4F7050F2-465F-4E10-8DB2-2FB97AC6AA43}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor.Web", "ImageProcessor.Web\ImageProcessor.Web.csproj", "{4F7050F2-465F-4E10-8DB2-2FB97AC6AA43}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

5
src/ImageProcessor/ImageFactory.cs

@ -318,7 +318,7 @@ namespace ImageProcessor
/// Rotates the current image by the given angle.
/// </summary>
/// <param name="rotateLayer">
/// The RotateLayer containing the properties to rotate the image.
/// The <see cref="T:ImageProcessor.Imaging.RotateLayer"/> containing the properties to rotate the image.
/// </param>
/// <returns>
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
@ -363,7 +363,8 @@ namespace ImageProcessor
/// Adds a text based watermark to the image
/// </summary>
/// <param name="textLayer">
/// The text layer containing the properties necessary to add the text based watermark to the image.
/// The <see cref="T:ImageProcessor.Imaging.TextLayer"/> containing the properties necessary to add
/// the text based watermark to the image.
/// </param>
/// <returns>
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.

7
src/ImageProcessor/ImageProcessor.sln.vsdoc

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- VSdocman config file for current project/solution.-->
<activeProfile>default</activeProfile>
<appSettings>
</appSettings>
</configuration>

105
src/ImageProcessor/ImageProcessor.vsdoc

@ -1,105 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- VSdocman config file for current project/solution.-->
<activeProfile>default</activeProfile>
<appSettings>
<add key="VBdocman_regexFilters"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<filters />]]></add>
<add key="VBdocman_comNonCommented"><![CDATA[-1]]></add>
<add key="VBdocman_comPublic"><![CDATA[-1]]></add>
<add key="VBdocman_comPrivate"><![CDATA[0]]></add>
<add key="VBdocman_comFriend"><![CDATA[0]]></add>
<add key="VBdocman_comProtected"><![CDATA[0]]></add>
<add key="VBdocman_comProtectedFriend"><![CDATA[0]]></add>
<add key="VBdocman_comMethod"><![CDATA[-1]]></add>
<add key="VBdocman_comStdModule"><![CDATA[0]]></add>
<add key="VBdocman_comObject"><![CDATA[-1]]></add>
<add key="VBdocman_comForm"><![CDATA[-1]]></add>
<add key="VBdocman_comProperty"><![CDATA[-1]]></add>
<add key="VBdocman_comEvent"><![CDATA[-1]]></add>
<add key="VBdocman_comVariable"><![CDATA[0]]></add>
<add key="VBdocman_comConstant"><![CDATA[0]]></add>
<add key="VBdocman_comEnumeration"><![CDATA[0]]></add>
<add key="VBdocman_comStructure"><![CDATA[0]]></add>
<add key="VBdocman_comDelegate"><![CDATA[0]]></add>
<add key="VBdocman_comInterface"><![CDATA[0]]></add>
<add key="VBdocman_comAttribute"><![CDATA[0]]></add>
<add key="VBdocman_comEventDecl"><![CDATA[0]]></add>
<add key="VBdocman_comDeclare"><![CDATA[0]]></add>
<add key="VBdocman_comContextID"><![CDATA[0]]></add>
<add key="VBdocman_comWriteDescription"><![CDATA[-1]]></add>
<add key="VBdocman_useConditionalCompilation"><![CDATA[0]]></add>
<add key="VBdocman_conditionalConstants"><![CDATA[]]></add>
<add key="VBdocman_showFormsSeparate"><![CDATA[0]]></add>
<add key="VBdocman_showInherited"><![CDATA[-1]]></add>
<add key="VBdocman_indentMode"><![CDATA[0]]></add>
<add key="VBdocman_insertSourceGlobal"><![CDATA[0]]></add>
<add key="VBdocman_unbreakSourceLines"><![CDATA[0]]></add>
<add key="VBdocman_removeAttributes"><![CDATA[0]]></add>
<add key="VBdocman_generateVbSyntax"><![CDATA[-1]]></add>
<add key="VBdocman_generateCsharpSyntax"><![CDATA[-1]]></add>
<add key="VBdocman_generateCppSyntax"><![CDATA[-1]]></add>
<add key="VBdocman_generateJscriptSyntax"><![CDATA[-1]]></add>
<add key="VBdocman_supportedPlatforms"><![CDATA[Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition]]></add>
<add key="VBdocman_supportedNetFramework"><![CDATA[3.0, 2.0, 1.1, 1.0]]></add>
<add key="VBdocman_supportedNetCompactFramework"><![CDATA[2.0, 1.0]]></add>
<add key="VBdocman_supportedXnaFramework"><![CDATA[1.0]]></add>
<add key="VBdocman_customVar1"><![CDATA[]]></add>
<add key="VBdocman_customVar2"><![CDATA[]]></add>
<add key="VBdocman_customVar3"><![CDATA[]]></add>
<add key="VBdocman_titlePageText"><![CDATA[]]></add>
<add key="VBdocman_rootNamespaceText"><![CDATA[]]></add>
<add key="VBdocman_rootNamespaceCommentStyle"><![CDATA[2]]></add>
<add key="VBdocman_pageFooterText"><![CDATA[Generated by VSdocman]]></add>
<add key="VBdocman_outputPath"><![CDATA[$(ProjectDir)VSdoc]]></add>
<add key="VBdocman_templateFolder"><![CDATA[$(VSdocmanDir)Templates]]></add>
<add key="VBdocman_externalFilesFolder"><![CDATA[]]></add>
<add key="VBdocman_fileNamingConvention"><![CDATA[1]]></add>
<add key="VBdocman_templateLocale"><![CDATA[en-US]]></add>
<add key="VBdocman_templatePath"><![CDATA[chm_msdn2.vbdt]]></add>
<add key="VBdocman_enumSorting"><![CDATA[1]]></add>
<add key="VBdocman_helpTitle"><![CDATA[ImageProcessor Reference]]></add>
<add key="VBdocman_customTopics"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<topics>
<topic>
<type>normal</type>
<is-default>yes</is-default>
<name>ImageProcessor Reference</name>
<id>imageprocessor_reference</id>
<comment><![CDATA[<summary></summary>vsdocman_escaped_]_]_></comment>
<namespaces />
<topics>
<topic>
<type>placeholder</type>
<is-default>no</is-default>
<name />
<id>e3cba20ec62e422b8bb39e6be7ca2142</id>
<comment><![CDATA[vsdocman_escaped_]_]_></comment>
<namespaces />
<topics />
</topic>
</topics>
</topic>
</topics>]]></add>
<add key="VBdocman_linkForExternalNotInFramework"><![CDATA[0]]></add>
<add key="VBdocman_allowMacrosInComments"><![CDATA[0]]></add>
<add key="VBdocman_emptyOutputFolder"><![CDATA[0]]></add>
<add key="VBdocman_comModules_Helpers...Extensions...EnumExtensions.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Helpers...Extensions...StringExtensions.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_ImageFactory.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Imaging...ImageUtils.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Imaging...OctreeQuantizer.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Imaging...Quantizer.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Imaging...ResponseType.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Imaging...TextLayer.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Processors...Alpha.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Processors...Copy of Watermark.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Processors...Crop.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Processors...Filter.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Processors...Quality.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Processors...Resize.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Processors...Vignette.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Processors...Watermark.cs"><![CDATA[On]]></add>
<add key="VBdocman_comModules_Properties...AssemblyInfo.cs"><![CDATA[On]]></add>
</appSettings>
</configuration>

2
src/ImageProcessor/Processors/Rotate.cs

@ -24,7 +24,7 @@ namespace ImageProcessor.Processors
/// <summary>
/// The regular expression to search strings for.
/// </summary>
private static readonly Regex QueryRegex = new Regex(@"rotate=((?:3[0-5][0-9]|[12][0-9]{2}|[1-9][0-9]?)|angle-(?:3[0-5][0-9]|[12][0-9]{2}|[1-9][0-9]?)\|bgcolor=([0-9a-fA-F]{3}){1,2})", RegexOptions.Compiled);
private static readonly Regex QueryRegex = new Regex(@"rotate=((?:3[0-5][0-9]|[12][0-9]{2}|[1-9][0-9]?)|angle-(?:3[0-5][0-9]|[12][0-9]{2}|[1-9][0-9]?)\|bgcolor-([0-9a-fA-F]{3}){1,2})", RegexOptions.Compiled);
/// <summary>
/// The regular expression to search strings for the angle attribute.

6
src/ImageProcessor/Properties/AssemblyInfo.cs

@ -11,7 +11,7 @@ using System.Security;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("James South")]
[assembly: AssemblyProduct("ImageProcessor")]
[assembly: AssemblyCopyright("Copyright ©")]
[assembly: AssemblyCopyright("Copyright © James South")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@ -32,6 +32,6 @@ using System.Security;
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

1
src/ImageProcessor/UpgradeLog.htm.REMOVED.git-id

@ -1 +0,0 @@
41192c06780bda40794dac2731a4105f1efe0311

20
src/Test/Test.sln

@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{30327C08-7574-4D7E-AC95-6A58753C6855}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{30327C08-7574-4D7E-AC95-6A58753C6855}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{30327C08-7574-4D7E-AC95-6A58753C6855}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30327C08-7574-4D7E-AC95-6A58753C6855}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30327C08-7574-4D7E-AC95-6A58753C6855}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

22
src/Test/Test/Content/style.css

@ -13,11 +13,29 @@ h1 {
font-size: 3em;
}
section section {
padding-bottom: 1em;
margin-bottom: 2em;
}
section section:nth-child(2n) {
color: #fff;
}
section section:nth-child(2) {
background-color: #00a9ec;
}
section section:nth-child(4) {
background-color: #ED1C24;
}
img {
background: #fff;
/*background: #fff;
padding: 3px;
-webkit-box-shadow: 0 0 5px rgb(0, 0, 0, 0.4);
box-shadow: 0 0 5px rgb(0, 0, 0, 0.4);
box-shadow: 0 0 5px rgb(0, 0, 0, 0.4);*/
}
.no-bullets {

3
src/Test/Test/Test.csproj

@ -117,9 +117,6 @@
<Folder Include="App_Data\" />
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ImageProcessor.Web\ImageProcessor.Web.csproj">
<Project>{4F7050F2-465F-4E10-8DB2-2FB97AC6AA43}</Project>

137
src/Test/Test/Views/Home/Index.cshtml

@ -1,57 +1,94 @@
@{
ViewBag.Title = "Home Page";
}
<section class="row">
@* <div class="clmn2">
<h2>Resized Image</h2>
<img src="/images/Penguins.jpg?width=300" />
<section>
<div class="container">
<div class="clmn2">
<h2>Resized</h2>
<img src="/images/Penguins.jpg?width=300" />
</div>
<div class="clmn2">
<h2>Cropped </h2>
<img src="/images/Penguins.jpg?crop=0-0-300-225" />
</div>
</div>
</section>
<section>
<div class="container">
<h2>Filter</h2>
<ul class="no-bullets clearfix">
<li>
<h3>blackwhite</h3>
<img src="/images/Penguins.jpg?width=300&filter=blackwhite" />
</li>
<li>
<h3>comic</h3>
<img src="/images/Penguins.jpg?width=300&filter=comic" />
</li>
<li>
<h3>lomograph</h3>
<img src="/images/Penguins.jpg?width=300&filter=lomograph" />
</li>
<li>
<h3>greyscale</h3>
<img src="/images/Penguins.jpg?width=300&filter=greyscale" />
</li>
<li>
<h3>polaroid</h3>
<img src="/images/Penguins.jpg?width=300&filter=polaroid" />
</li>
<li>
<h3>sepia</h3>
<img src="/images/Penguins.jpg?width=300&filter=sepia" />
</li>
<li>
<h3>gotham</h3>
<img src="/images/Penguins.jpg?width=300&filter=gotham" />
</li>
<li>
<h3>hisatch</h3>
<img src="/images/Penguins.jpg?width=300&filter=hisatch" />
</li>
<li>
<h3>losatch</h3>
<img src="/images/Penguins.jpg?width=300&filter=losatch" />
</li>
</ul>
</div>
<div class="clmn2">
<h2>Cropped Image</h2>
<img src="/images/Penguins.jpg?crop=0-0-300-225" />
</div>*@
</section>
<section>
<h2>Filtered Image</h2>
<ul class="no-bullets clearfix">
<li>
<h3>blackwhite</h3>
<img src="/images/Penguins.jpg?width=300&filter=blackwhite" />
</li>
<li>
<h3>comic</h3>
<img src="/images/Penguins.jpg?width=300&filter=comic" />
</li>
<li>
<h3>lomograph</h3>
<img src="/images/Penguins.jpg?width=300&filter=lomograph" />
</li>
@* <li>
<h3>greyscale</h3>
<img src="/images/Penguins.jpg?width=300&filter=greyscale" />
</li>
<li>
<h3>polaroid</h3>
<img src="/images/Penguins.jpg?width=300&filter=polaroid" />
</li>
<li>
<h3>sepia</h3>
<img src="/images/Penguins.jpg?width=300&filter=sepia" />
</li>
<li>
<h3>gotham</h3>
<img src="/images/Penguins.jpg?width=300&filter=gotham" />
</li>
<li>
<h3>hisatch</h3>
<img src="/images/Penguins.jpg?width=300&filter=hisatch" />
</li>
<li>
<h3>losatch</h3>
<img src="/images/Penguins.jpg?width=300&filter=losatch" />
</li>*@
</ul>
<div class="container">
<div class="clmn2">
<h2>Watermark</h2>
<img src="/images/Penguins.jpg?width=300&watermark=text-test|color-fff|size-48|style-italic|opacity-100|position-100-100|shadow-true|font-arial" />
</div>
<div class="clmn2">
<h2>Format</h2>
<img src="/images/Penguins.jpg?width=300&format=gif" />
</div>
</div>
</section>
<section>
<div class="container">
<div class="clmn2">
<h2>Rotate</h2>
<img src="/images/Penguins.jpg?width=300&rotate=angle-54|bgcolor-fff" />
</div>
<div class="clmn2">
<h2>Quality</h2>
<img src="/images/Penguins.jpg?width=300&quality=5" />
</div>
</div>
</section>
<section>
<div class="container">
<div class="clmn2">
<h2>Alpha</h2>
<img src="/images/Penguins.jpg?width=300&format=png&alpha=50" />
</div>
<div class="clmn2">
<h2>Remote</h2>
<img src="/remote.axd?http://images.mymovies.net/images/film/cin/500x377/fid11707.jpg?width=300" />
</div>
</div>
</section>
@*<h3>Remote image test</h3>
<img src="/remote.axd?http://images.mymovies.net/images/film/cin/500x377/fid11707.jpg?width=200" />*@

19
src/Test/Test/Views/Shared/_Layout.cshtml

@ -8,17 +8,16 @@
</head>
<body>
<div class="page">
<div class="container">
<header>
<div>
<h1>ImageProcessor Test Website</h1>
</div>
</header>
<section id="main">
@RenderBody()
</section>
</div>
<header>
<div class="container">
<h1>ImageProcessor Test Website</h1>
</div>
</header>
<section id="main">
@RenderBody()
</section>
</div>
<footer class="page-footer">
</footer>
</body>

204
src/Test/Test/Web.config

@ -1,117 +1,87 @@
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<!-- Configuration section-handler declaration area. -->
<configSections>
<sectionGroup name="imageProcessor">
<section name="security" requirePermission="false" type="ImageProcessor.Web.Config.ImageSecuritySection, ImageProcessor.Web"/>
<section name="processing" requirePermission="false" type="ImageProcessor.Web.Config.ImageProcessingSection, ImageProcessor.Web" />
<section name="cache" requirePermission="false" type="ImageProcessor.Web.Config.ImageCacheSection, ImageProcessor.Web" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages"/>
</namespaces>
</pages>
<httpModules>
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>
</httpModules>
<!--Set the trust level.-->
<!--<trust level="Medium"/>-->
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<imageProcessor>
<security allowRemoteDownloads="true" timeout="300000" maxBytes="524288" remotePrefix="/remote.axd">
<whiteList>
<add url="http://images.mymovies.net"/>
</whiteList>
</security>
<cache virtualPath="~/cache" maxDays="7" />
<processing>
<plugins>
<plugin name ="Resize">
<settings>
<setting key="MaxWidth" value="1024"/>
<setting key="MaxHeight" value="768"/>
</settings>
</plugin>
</plugins>
</processing>
</imageProcessor>
</configuration>
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<!-- Configuration section-handler declaration area. -->
<configSections>
<sectionGroup name="imageProcessor">
<section name="security" requirePermission="false" type="ImageProcessor.Web.Config.ImageSecuritySection, ImageProcessor.Web"/>
<section name="processing" requirePermission="false" type="ImageProcessor.Web.Config.ImageProcessingSection, ImageProcessor.Web" />
<section name="cache" requirePermission="false" type="ImageProcessor.Web.Config.ImageCacheSection, ImageProcessor.Web" />
</sectionGroup>
</configSections>
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages"/>
</namespaces>
</pages>
<httpModules>
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>
</httpModules>
<!--Set the trust level.-->
<!--<trust level="Medium"/>-->
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<imageProcessor>
<security allowRemoteDownloads="true" timeout="300000" maxBytes="524288" remotePrefix="/remote.axd">
<whiteList>
<add url="http://images.mymovies.net"/>
</whiteList>
</security>
<cache virtualPath="~/cache" maxDays="365" />
<processing>
<plugins>
<plugin name ="Resize">
<settings>
<setting key="MaxWidth" value="1024"/>
<setting key="MaxHeight" value="768"/>
</settings>
</plugin>
</plugins>
</processing>
</imageProcessor>
</configuration>

4
src/Test/Test/packages.config

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="4.1.10331.0" />
</packages>
Loading…
Cancel
Save