forked from JimBobSquarePants/ImageProcessor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added configuration-less functionality.
- Loading branch information
1 parent
d730995
commit 4986877
Showing
11 changed files
with
172 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<cache virtualPath="~/app_data/cache" maxDays="356"/> |
39 changes: 39 additions & 0 deletions
39
src/ImageProcessor.Web/NET45/Config/Resources/processing.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<processing> | ||
<presets> | ||
</presets> | ||
<plugins autoLoadPlugins="true"> | ||
<plugin name="Alpha" type="ImageProcessor.Processors.Alpha, ImageProcessor"/> | ||
<plugin name="Brightness" type="ImageProcessor.Processors.Brightness, ImageProcessor"/> | ||
<plugin name="Contrast" type="ImageProcessor.Processors.Contrast, ImageProcessor"/> | ||
<plugin name="Crop" type="ImageProcessor.Processors.Crop, ImageProcessor"/> | ||
<plugin name="Filter" type="ImageProcessor.Processors.Filter, ImageProcessor"/> | ||
<plugin name="Flip" type="ImageProcessor.Processors.Flip, ImageProcessor"/> | ||
<plugin name="Format" type="ImageProcessor.Processors.Format, ImageProcessor"/> | ||
<plugin name="GaussianBlur" type="ImageProcessor.Processors.GaussianBlur, ImageProcessor"> | ||
<settings> | ||
<setting key="MaxSize" value="22"/> | ||
<setting key="MaxSigma" value="5.1"/> | ||
<setting key="MaxThreshold" value="100"/> | ||
</settings> | ||
</plugin> | ||
<plugin name="GaussianSharpen" type="ImageProcessor.Processors.GaussianSharpen, ImageProcessor"> | ||
<settings> | ||
<setting key="MaxSize" value="22"/> | ||
<setting key="MaxSigma" value="5.1"/> | ||
<setting key="MaxThreshold" value="100"/> | ||
</settings> | ||
</plugin> | ||
<plugin name="Quality" type="ImageProcessor.Processors.Quality, ImageProcessor"/> | ||
<plugin name="Resize" type="ImageProcessor.Processors.Resize, ImageProcessor"> | ||
<settings> | ||
<setting key="MaxWidth" value="5000"/> | ||
<setting key="MaxHeight" value="5000"/> | ||
</settings> | ||
</plugin> | ||
<plugin name="Rotate" type="ImageProcessor.Processors.Rotate, ImageProcessor"/> | ||
<plugin name="RoundedCorners" type="ImageProcessor.Processors.RoundedCorners, ImageProcessor"/> | ||
<plugin name="Saturation" type="ImageProcessor.Processors.Saturation, ImageProcessor"/> | ||
<plugin name="Vignette" type="ImageProcessor.Processors.Vignette, ImageProcessor"/> | ||
<plugin name="Watermark" type="ImageProcessor.Processors.Watermark, ImageProcessor"/> | ||
</plugins> | ||
</processing> |
4 changes: 4 additions & 0 deletions
4
src/ImageProcessor.Web/NET45/Config/Resources/security.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<security allowRemoteDownloads="true" timeout="300000" maxBytes="4194304" remotePrefix="/remote.axd"> | ||
<whiteList> | ||
</whiteList> | ||
</security> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="ResourceHelpers.cs" company="James South"> | ||
// Copyright (c) James South. | ||
// Licensed under the Apache License, Version 2.0. | ||
// </copyright> | ||
// <summary> | ||
// Provides helper methods for working with resources. | ||
// </summary> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace ImageProcessor.Web.Helpers | ||
{ | ||
using System.IO; | ||
using System.Reflection; | ||
using System.Text; | ||
|
||
/// <summary> | ||
/// Provides helper methods for working with resources. | ||
/// </summary> | ||
public class ResourceHelpers | ||
{ | ||
/// <summary> | ||
/// Converts an assembly resource into a string. | ||
/// </summary> | ||
/// <param name="resource"> | ||
/// The resource. | ||
/// </param> | ||
/// <param name="assembly"> | ||
/// The assembly. | ||
/// </param> | ||
/// <param name="encoding"> | ||
/// The character encoding to return the resource in. | ||
/// </param> | ||
/// <returns> | ||
/// The <see cref="string"/>. | ||
/// </returns> | ||
public static string ResourceAsString(string resource, Assembly assembly = null, Encoding encoding = null) | ||
{ | ||
assembly = assembly ?? Assembly.GetExecutingAssembly(); | ||
encoding = encoding ?? Encoding.UTF8; | ||
|
||
using (MemoryStream ms = new MemoryStream()) | ||
{ | ||
using (Stream manifestResourceStream = assembly.GetManifestResourceStream(resource)) | ||
{ | ||
if (manifestResourceStream != null) | ||
{ | ||
manifestResourceStream.CopyTo(ms); | ||
} | ||
} | ||
|
||
return encoding.GetString(ms.GetBuffer()).Replace('\0', ' ').Trim(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.