mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Conflicts: src/ImageProcessor.Web/NET45/Properties/AssemblyInfo.cs Former-commit-id: ecbe1e3bec56a3761a5b62136318ecf93de40646pull/17/head
28 changed files with 260 additions and 58 deletions
@ -0,0 +1 @@ |
|||
<cache virtualPath="~/app_data/cache" maxDays="356"/> |
|||
@ -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> |
|||
@ -0,0 +1,4 @@ |
|||
<security allowRemoteDownloads="true" timeout="300000" maxBytes="4194304" remotePrefix="/remote.axd"> |
|||
<whiteList> |
|||
</whiteList> |
|||
</security> |
|||
@ -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(); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
// --------------------------------------------------------------------------------------------------------------------
|
|||
// <copyright file="StartUp.cs" company="James South">
|
|||
// Copyright (c) James South.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
// <summary>
|
|||
// Provides methods to handle startup events.
|
|||
// </summary>
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
|||
|
|||
[assembly: System.Web.PreApplicationStartMethod(typeof(ImageProcessor.Web.Helpers.StartUp), "PreApplicationStart")] |
|||
|
|||
namespace ImageProcessor.Web.Helpers |
|||
{ |
|||
using ImageProcessor.Web.HttpModules; |
|||
using Microsoft.Web.Infrastructure.DynamicModuleHelper; |
|||
|
|||
/// <summary>
|
|||
/// Provides methods to handle startup events.
|
|||
/// </summary>
|
|||
public static class StartUp |
|||
{ |
|||
/// <summary>
|
|||
/// The pre application start.
|
|||
/// </summary>
|
|||
public static void PreApplicationStart() |
|||
{ |
|||
DynamicModuleUtility.RegisterModule(typeof(ImageProcessingModule)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -1 +0,0 @@ |
|||
3fc6418ca4779d20c4fad1afc82a3693dd93b9e4 |
|||
@ -1 +0,0 @@ |
|||
b334b903dac55dfc5156a814c1fce9cc1f10f744 |
|||
@ -1 +0,0 @@ |
|||
effc95273383a6d336dd589cf684b3952cb98699 |
|||
@ -0,0 +1 @@ |
|||
8aabc0ada547c28930a04d63f23c2d7e429ef88d |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue