From 99a95b963adbdb6c506bec36d69ef49fb1835e54 Mon Sep 17 00:00:00 2001 From: Kenny Burns Date: Tue, 1 Jul 2014 15:46:35 +0100 Subject: [PATCH 1/6] Minor update to DiskCache to prevent unauthorized permission issue over UNC share Former-commit-id: b70c0f3c84f1922537035741651a5f51a8ec4d4d --- .../NET45/Caching/DiskCache.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs b/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs index 7d4150f45..421070612 100644 --- a/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs +++ b/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs @@ -51,7 +51,7 @@ namespace ImageProcessor.Web.Caching /// /// The absolute path to virtual cache path on the server. /// - private static readonly string AbsoluteCachePath = HostingEnvironment.MapPath(ImageProcessorConfig.Instance.VirtualCachePath); + public static readonly string AbsoluteCachePath = HostingEnvironment.MapPath(ImageProcessorConfig.Instance.VirtualCachePath); /// /// The request for the image. @@ -229,7 +229,7 @@ namespace ImageProcessor.Web.Caching DirectoryInfo parentDirectoryInfo = directoryInfo.Parent; // ReSharper disable once PossibleNullReferenceException - foreach (DirectoryInfo enumerateDirectory in parentDirectoryInfo.EnumerateDirectories()) + foreach (DirectoryInfo enumerateDirectory in SafeEnumerateDirectories(parentDirectoryInfo)) { IEnumerable files = enumerateDirectory.EnumerateFiles().OrderBy(f => f.CreationTimeUtc); int count = files.Count(); @@ -260,6 +260,22 @@ namespace ImageProcessor.Web.Caching } } + public static IEnumerable SafeEnumerateDirectories(DirectoryInfo directoryInfo) + { + IEnumerable directories; + + try + { + directories = directoryInfo.EnumerateDirectories(); + } + catch + { + return Enumerable.Empty(); + } + + return directories; + } + /// /// Gets the full transformed cached path for the image. /// The images are stored in paths that are based upon the sha1 of their full request path From 3b9dce8e954dd41f574a4276ed62161148b98b6c Mon Sep 17 00:00:00 2001 From: Kenny Burns Date: Tue, 1 Jul 2014 15:51:43 +0100 Subject: [PATCH 2/6] Revert AbsoluteCachePath back to original (private) Former-commit-id: 5be9b3a3edc51c0b54a7ae432796428e0c5035f8 --- src/ImageProcessor.Web/NET45/Caching/DiskCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs b/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs index 421070612..1cdcfcb2f 100644 --- a/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs +++ b/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs @@ -51,7 +51,7 @@ namespace ImageProcessor.Web.Caching /// /// The absolute path to virtual cache path on the server. /// - public static readonly string AbsoluteCachePath = HostingEnvironment.MapPath(ImageProcessorConfig.Instance.VirtualCachePath); + private static readonly string AbsoluteCachePath = HostingEnvironment.MapPath(ImageProcessorConfig.Instance.VirtualCachePath); /// /// The request for the image. From a8289fba948b613172252e41ebdd28cbf1b2b5db Mon Sep 17 00:00:00 2001 From: James South Date: Tue, 1 Jul 2014 22:42:16 +0100 Subject: [PATCH 3/6] v1.9.4, v3.2.9, v1.1.3 Former-commit-id: c038bd08676e26026efa8a6ea25e39ffdfd222e9 --- build/Build.bat | 10 +-- .../NuSpecs/ImageProcessor.Web.Config.nuspec | 8 +-- build/NuSpecs/ImageProcessor.Web.nuspec | 4 +- .../web.config.transform | 4 -- .../ImageProcessor.UnitTests.csproj | 15 ++-- .../NET4/ImageProcessor.Web_NET4.csproj | 3 + .../NET45/Caching/DiskCache.cs | 69 ++++++++----------- .../Extensions/DirectoryInfoExtensions.cs | 56 +++++++++++++++ .../NET45/ImageProcessor.Web_NET45.csproj | 1 + .../NET45/Properties/AssemblyInfo.cs | 4 +- src/ImageProcessor/Properties/AssemblyInfo.cs | 4 +- 11 files changed, 114 insertions(+), 64 deletions(-) create mode 100644 src/ImageProcessor.Web/NET45/Extensions/DirectoryInfoExtensions.cs diff --git a/build/Build.bat b/build/Build.bat index 94f43b25c..e685375b6 100644 --- a/build/Build.bat +++ b/build/Build.bat @@ -1,13 +1,13 @@ @ECHO OFF -SET version=1.9.3.0 -SET webversion=3.2.8.0 -SET webconfigversion=1.1.2.0 +SET version=1.9.4.0 +SET webversion=3.2.9.0 +SET webconfigversion=1.1.3.0 ECHO Building ImageProcessor %version%, ImageProcess.Web %webversion% and ImageProcess.Web.Config %webconfigversion% ECHO Installing the Microsoft.Bcl.Build package before anything else, otherwise you'd have to run build.cmd twice SET nuGetFolder=%CD%\..\src\packages\ -..\src\.nuget\NuGet.exe install ..\src\ImageProcessor.Web\NET45\packages.config -OutputDirectory %nuGetFolder% +..\src\.nuget\NuGet.exe install ..\src\ImageProcessor.Web\NET4\packages.config -OutputDirectory %nuGetFolder% ECHO Removing _BuildOutput directory so everything is nice and clean RD _BuildOutput /q /s @@ -19,7 +19,7 @@ ECHO Packing the NuGet release files ..\src\.nuget\NuGet.exe pack NuSpecs\ImageProcessor.nuspec -Version %version% ..\src\.nuget\NuGet.exe pack NuSpecs\ImageProcessor.Web.nuspec -Version %webversion% ..\src\.nuget\NuGet.exe pack NuSpecs\ImageProcessor.Web.Config.nuspec -Version %webconfigversion% - +PAUSE IF ERRORLEVEL 1 GOTO :showerror diff --git a/build/NuSpecs/ImageProcessor.Web.Config.nuspec b/build/NuSpecs/ImageProcessor.Web.Config.nuspec index cb27a3fb2..b3105cd50 100644 --- a/build/NuSpecs/ImageProcessor.Web.Config.nuspec +++ b/build/NuSpecs/ImageProcessor.Web.Config.nuspec @@ -21,12 +21,12 @@ Feedback is always welcome 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 - - + + - - + + diff --git a/build/NuSpecs/ImageProcessor.Web.nuspec b/build/NuSpecs/ImageProcessor.Web.nuspec index 5e640a422..e706fbf27 100644 --- a/build/NuSpecs/ImageProcessor.Web.nuspec +++ b/build/NuSpecs/ImageProcessor.Web.nuspec @@ -27,10 +27,10 @@ Feedback is always welcome - + - + diff --git a/build/content/ImageProcessor.Web.Config/web.config.transform b/build/content/ImageProcessor.Web.Config/web.config.transform index c2ed6d5a1..84b0a6f96 100644 --- a/build/content/ImageProcessor.Web.Config/web.config.transform +++ b/build/content/ImageProcessor.Web.Config/web.config.transform @@ -13,8 +13,4 @@ - - - - diff --git a/src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj b/src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj index c9d6a7da8..6fb6fd2bd 100644 --- a/src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj +++ b/src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj @@ -1,4 +1,4 @@ - + Debug @@ -8,6 +8,8 @@ ImageProcessor.UnitTests ImageProcessor.UnitTests Client + ..\ + true true @@ -162,7 +164,12 @@ PreserveNewest - - - + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/src/ImageProcessor.Web/NET4/ImageProcessor.Web_NET4.csproj b/src/ImageProcessor.Web/NET4/ImageProcessor.Web_NET4.csproj index cad554bb4..1bd78044d 100644 --- a/src/ImageProcessor.Web/NET4/ImageProcessor.Web_NET4.csproj +++ b/src/ImageProcessor.Web/NET4/ImageProcessor.Web_NET4.csproj @@ -87,6 +87,9 @@ + + DirectoryInfoExtensions.cs + ImageHelpers.cs diff --git a/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs b/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs index 1cdcfcb2f..57c29f3eb 100644 --- a/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs +++ b/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs @@ -22,6 +22,7 @@ namespace ImageProcessor.Web.Caching using System.Web.Hosting; using ImageProcessor.Extensions; using ImageProcessor.Web.Config; + using ImageProcessor.Web.Extensions; using ImageProcessor.Web.Helpers; #endregion @@ -224,58 +225,44 @@ namespace ImageProcessor.Web.Caching /// private void TrimCachedFolders(string path) { - // ReSharper disable once AssignNullToNotNullAttribute - DirectoryInfo directoryInfo = new DirectoryInfo(Path.GetDirectoryName(path)); - DirectoryInfo parentDirectoryInfo = directoryInfo.Parent; - - // ReSharper disable once PossibleNullReferenceException - foreach (DirectoryInfo enumerateDirectory in SafeEnumerateDirectories(parentDirectoryInfo)) + string directory = Path.GetDirectoryName(path); + if (directory != null) { - IEnumerable files = enumerateDirectory.EnumerateFiles().OrderBy(f => f.CreationTimeUtc); - int count = files.Count(); + DirectoryInfo directoryInfo = new DirectoryInfo(directory); + DirectoryInfo parentDirectoryInfo = directoryInfo.Parent; - foreach (FileInfo fileInfo in files) + foreach (DirectoryInfo enumerateDirectory in parentDirectoryInfo.SafeEnumerateDirectories()) { - try + IEnumerable files = enumerateDirectory.EnumerateFiles().OrderBy(f => f.CreationTimeUtc); + int count = files.Count(); + + foreach (FileInfo fileInfo in files) { - // If the group count is equal to the max count minus 1 then we know we - // have reduced the number of items below the maximum allowed. - // We'll cleanup any orphaned expired files though. - if (!this.IsExpired(fileInfo.CreationTimeUtc) && count <= MaxFilesCount - 1) + try { - break; + // If the group count is equal to the max count minus 1 then we know we + // have reduced the number of items below the maximum allowed. + // We'll cleanup any orphaned expired files though. + if (!this.IsExpired(fileInfo.CreationTimeUtc) && count <= MaxFilesCount - 1) + { + break; + } + + // Remove from the cache and delete each CachedImage. + CacheIndexer.Remove(fileInfo.Name); + fileInfo.Delete(); + count -= 1; + } + // ReSharper disable once EmptyGeneralCatchClause + catch + { + // Do nothing; skip to the next file. } - - // Remove from the cache and delete each CachedImage. - CacheIndexer.Remove(fileInfo.Name); - fileInfo.Delete(); - count -= 1; - } - // ReSharper disable once EmptyGeneralCatchClause - catch - { - // Do nothing; skip to the next file. } } } } - public static IEnumerable SafeEnumerateDirectories(DirectoryInfo directoryInfo) - { - IEnumerable directories; - - try - { - directories = directoryInfo.EnumerateDirectories(); - } - catch - { - return Enumerable.Empty(); - } - - return directories; - } - /// /// Gets the full transformed cached path for the image. /// The images are stored in paths that are based upon the sha1 of their full request path diff --git a/src/ImageProcessor.Web/NET45/Extensions/DirectoryInfoExtensions.cs b/src/ImageProcessor.Web/NET45/Extensions/DirectoryInfoExtensions.cs new file mode 100644 index 000000000..07c47e522 --- /dev/null +++ b/src/ImageProcessor.Web/NET45/Extensions/DirectoryInfoExtensions.cs @@ -0,0 +1,56 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) James South. +// Licensed under the Apache License, Version 2.0. +// +// +// Provides extension methods to the type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace ImageProcessor.Web.Extensions +{ + using System.Collections.Generic; + using System.IO; + using System.Linq; + + /// + /// Provides extension methods to the type. + /// + public static class DirectoryInfoExtensions + { + /// + /// Returns an enumerable collection of directory information that matches a specified search pattern and search subdirectory option. + /// Will return an empty enumerable on exception. Quick and dirty but does what I need just now. + /// + /// + /// The that this method extends. + /// + /// + /// The search string to match against the names of directories. This parameter can contain a combination of valid literal path + /// and wildcard (* and ?) characters (see Remarks), but doesn't support regular expressions. The default pattern is "*", which returns all files. + /// + /// + /// One of the enumeration values that specifies whether the search operation should include only + /// the current directory or all subdirectories. The default value is TopDirectoryOnly. + /// + /// + /// An enumerable collection of directories that matches searchPattern and searchOption. + /// + public static IEnumerable SafeEnumerateDirectories(this DirectoryInfo directoryInfo, string searchPattern = "*", SearchOption searchOption = SearchOption.TopDirectoryOnly) + { + IEnumerable directories; + + try + { + directories = directoryInfo.EnumerateDirectories(searchPattern, searchOption); + } + catch + { + return Enumerable.Empty(); + } + + return directories; + } + } +} \ No newline at end of file diff --git a/src/ImageProcessor.Web/NET45/ImageProcessor.Web_NET45.csproj b/src/ImageProcessor.Web/NET45/ImageProcessor.Web_NET45.csproj index 23cc45e96..c2a7c9403 100644 --- a/src/ImageProcessor.Web/NET45/ImageProcessor.Web_NET45.csproj +++ b/src/ImageProcessor.Web/NET45/ImageProcessor.Web_NET45.csproj @@ -53,6 +53,7 @@ + diff --git a/src/ImageProcessor.Web/NET45/Properties/AssemblyInfo.cs b/src/ImageProcessor.Web/NET45/Properties/AssemblyInfo.cs index e8c655990..e09d25366 100644 --- a/src/ImageProcessor.Web/NET45/Properties/AssemblyInfo.cs +++ b/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 // by using the '*' as shown below: -[assembly: AssemblyVersion("3.2.8.0")] -[assembly: AssemblyFileVersion("3.2.8.0")] \ No newline at end of file +[assembly: AssemblyVersion("3.2.9.0")] +[assembly: AssemblyFileVersion("3.2.9.0")] \ No newline at end of file diff --git a/src/ImageProcessor/Properties/AssemblyInfo.cs b/src/ImageProcessor/Properties/AssemblyInfo.cs index bea6c1401..30065502c 100644 --- a/src/ImageProcessor/Properties/AssemblyInfo.cs +++ b/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 // by using the '*' as shown below: -[assembly: AssemblyVersion("1.9.3.0")] -[assembly: AssemblyFileVersion("1.9.3.0")] +[assembly: AssemblyVersion("1.9.4.0")] +[assembly: AssemblyFileVersion("1.9.4.0")] From 0a3da369bd01e376744626dd98fe9d63c4c33de7 Mon Sep 17 00:00:00 2001 From: James South Date: Fri, 1 Aug 2014 16:11:17 +0100 Subject: [PATCH 4/6] Fixing issue #65 Former-commit-id: 9a4586e9026e8aba301a41038a3976a5920f981b --- .../NET45/Caching/DiskCache.cs | 72 ++++++++++--------- .../HttpModules/ImageProcessingModule.cs | 10 ++- .../NET45/Properties/AssemblyInfo.cs | 4 +- 3 files changed, 44 insertions(+), 42 deletions(-) diff --git a/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs b/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs index 57c29f3eb..c046cfd8a 100644 --- a/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs +++ b/src/ImageProcessor.Web/NET45/Caching/DiskCache.cs @@ -47,17 +47,17 @@ namespace ImageProcessor.Web.Caching /// /// /// - private const int MaxFilesCount = 50; + private const int MaxFilesCount = 100; /// - /// The absolute path to virtual cache path on the server. + /// The virtual cache path. /// - private static readonly string AbsoluteCachePath = HostingEnvironment.MapPath(ImageProcessorConfig.Instance.VirtualCachePath); + private static readonly string VirtualCachePath = ImageProcessorConfig.Instance.VirtualCachePath; /// - /// The request for the image. + /// The absolute path to virtual cache path on the server. /// - private readonly HttpRequest request; + private static readonly string AbsoluteCachePath = HostingEnvironment.MapPath(ImageProcessorConfig.Instance.VirtualCachePath); /// /// The request path for the image. @@ -78,15 +78,22 @@ namespace ImageProcessor.Web.Caching /// Whether the request is for a remote image. /// private readonly bool isRemote; + + /// + /// The physical cached path. + /// + private string physicalCachedPath; + + /// + /// The virtual cached path. + /// + private string virtualCachedPath; #endregion #region Constructors /// /// Initializes a new instance of the class. /// - /// - /// The request for the image. - /// /// /// The request path for the image. /// @@ -99,14 +106,15 @@ namespace ImageProcessor.Web.Caching /// /// Whether the request is for a remote image. /// - public DiskCache(HttpRequest request, string requestPath, string fullPath, string imageName, bool isRemote) + public DiskCache(string requestPath, string fullPath, string imageName, bool isRemote) { - this.request = request; this.requestPath = requestPath; this.fullPath = fullPath; this.imageName = imageName; this.isRemote = isRemote; - this.CachedPath = this.GetCachePath(); + + // Get the physical and virtual paths. + this.GetCachePaths(); } #endregion @@ -114,30 +122,28 @@ namespace ImageProcessor.Web.Caching /// /// Gets the cached path. /// - internal string CachedPath { get; private set; } - #endregion + public string CachedPath + { + get + { + return this.physicalCachedPath; + } + } - #region Methods - #region Internal /// - /// Gets the virtual path to the cached processed image. + /// Gets the cached path. /// - /// The virtual path to the cached processed image. - internal string GetVirtualCachedPath() + public string VirtualCachedPath { - string applicationPath = this.request.PhysicalApplicationPath; - string virtualDir = this.request.ApplicationPath; - virtualDir = virtualDir == "/" ? virtualDir : (virtualDir + "/"); - - if (applicationPath != null) + get { - return this.CachedPath.Replace(applicationPath, virtualDir).Replace(@"\", "/"); + return this.virtualCachedPath; } - - throw new InvalidOperationException( - "We can only map an absolute back to a relative path if the application path is available."); } + #endregion + #region Methods + #region Internal /// /// Adds an image to the cache. /// @@ -269,11 +275,9 @@ namespace ImageProcessor.Web.Caching /// taking the individual characters of the hash to determine their location. /// This allows us to store millions of images. /// - /// The full cached path for the image. [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "Reviewed. Suppression is OK here.")] - private string GetCachePath() + private void GetCachePaths() { - string cachedPath = string.Empty; string streamHash = string.Empty; if (AbsoluteCachePath != null) @@ -304,23 +308,23 @@ namespace ImageProcessor.Web.Caching // Use an sha1 hash of the full path including the querystring to create the image name. // That name can also be used as a key for the cached image and we should be able to use - // The characters of that hash as subfolders. + // The characters of that hash as sub-folders. string parsedExtension = ImageHelpers.GetExtension(this.fullPath); string fallbackExtension = this.imageName.Substring(this.imageName.LastIndexOf(".", StringComparison.Ordinal) + 1); string encryptedName = (streamHash + this.fullPath).ToSHA1Fingerprint(); // Collision rate of about 1 in 10000 for the folder structure. string pathFromKey = string.Join("\\", encryptedName.ToCharArray().Take(6)); + string virtualPathFromKey = pathFromKey.Replace(@"\", "/"); string cachedFileName = string.Format( "{0}.{1}", encryptedName, !string.IsNullOrWhiteSpace(parsedExtension) ? parsedExtension.Replace(".", string.Empty) : fallbackExtension); - cachedPath = Path.Combine(AbsoluteCachePath, pathFromKey, cachedFileName); + this.physicalCachedPath = Path.Combine(AbsoluteCachePath, pathFromKey, cachedFileName); + this.virtualCachedPath = Path.Combine(VirtualCachePath, virtualPathFromKey, cachedFileName).Replace(@"\", "/"); } - - return cachedPath; } /// diff --git a/src/ImageProcessor.Web/NET45/HttpModules/ImageProcessingModule.cs b/src/ImageProcessor.Web/NET45/HttpModules/ImageProcessingModule.cs index 22c03bef7..8bf539b54 100644 --- a/src/ImageProcessor.Web/NET45/HttpModules/ImageProcessingModule.cs +++ b/src/ImageProcessor.Web/NET45/HttpModules/ImageProcessingModule.cs @@ -346,14 +346,14 @@ namespace ImageProcessor.Web.HttpModules } // Create a new cache to help process and cache the request. - DiskCache cache = new DiskCache(request, requestPath, fullPath, imageName, isRemote); + DiskCache cache = new DiskCache(requestPath, fullPath, imageName, isRemote); // Since we are now rewriting the path we need to check again that the current user has access // to the rewritten path. // Get the user for the current request // If the user is anonymous or authentication doesn't work for this suffix avoid a NullReferenceException // in the UrlAuthorizationModule by creating a generic identity. - string virtualCachedPath = cache.GetVirtualCachedPath(); + string virtualCachedPath = cache.VirtualCachedPath; IPrincipal user = context.User ?? new GenericPrincipal(new GenericIdentity(string.Empty, string.Empty), new string[0]); @@ -475,7 +475,7 @@ namespace ImageProcessor.Web.HttpModules context.Response.AddHeader("Content-Length", "0"); context.Response.StatusCode = (int)HttpStatusCode.NotModified; context.Response.SuppressContent = true; - context.Response.AddFileDependency(context.Server.MapPath(cache.GetVirtualCachedPath())); + context.Response.AddFileDependency(context.Server.MapPath(virtualCachedPath)); this.SetHeaders(context, (string)context.Items[CachedResponseTypeKey]); if (!isRemote) @@ -484,10 +484,8 @@ namespace ImageProcessor.Web.HttpModules } } - string virtualPath = cache.GetVirtualCachedPath(); - // The cached file is valid so just rewrite the path. - context.RewritePath(virtualPath, false); + context.RewritePath(virtualCachedPath, false); } else { diff --git a/src/ImageProcessor.Web/NET45/Properties/AssemblyInfo.cs b/src/ImageProcessor.Web/NET45/Properties/AssemblyInfo.cs index e09d25366..831e5543e 100644 --- a/src/ImageProcessor.Web/NET45/Properties/AssemblyInfo.cs +++ b/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 // by using the '*' as shown below: -[assembly: AssemblyVersion("3.2.9.0")] -[assembly: AssemblyFileVersion("3.2.9.0")] \ No newline at end of file +[assembly: AssemblyVersion("3.3.0.0")] +[assembly: AssemblyFileVersion("3.3.0.0")] \ No newline at end of file From 9c7d941ab1e599034579b386f44f4b486c119469 Mon Sep 17 00:00:00 2001 From: James South Date: Fri, 1 Aug 2014 16:12:21 +0100 Subject: [PATCH 5/6] Preventing disposal of semaphore objects until app end. Former-commit-id: 07a2f240257e2827220204e59a5c7bc7a45bc1cd --- .../NET45/HttpModules/ImageProcessingModule.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ImageProcessor.Web/NET45/HttpModules/ImageProcessingModule.cs b/src/ImageProcessor.Web/NET45/HttpModules/ImageProcessingModule.cs index 8bf539b54..289062965 100644 --- a/src/ImageProcessor.Web/NET45/HttpModules/ImageProcessingModule.cs +++ b/src/ImageProcessor.Web/NET45/HttpModules/ImageProcessingModule.cs @@ -179,12 +179,12 @@ namespace ImageProcessor.Web.HttpModules if (disposing) { // Dispose of any managed resources here. - foreach (KeyValuePair semaphore in SemaphoreSlims) - { - semaphore.Value.Dispose(); - } + //foreach (KeyValuePair semaphore in SemaphoreSlims) + //{ + // semaphore.Value.Dispose(); + //} - SemaphoreSlims.Clear(); + //SemaphoreSlims.Clear(); } // Call the appropriate methods to clean up From 876f6d8feddc0cd6bc7d615c063e54f563f3ca27 Mon Sep 17 00:00:00 2001 From: James South Date: Fri, 1 Aug 2014 16:28:48 +0100 Subject: [PATCH 6/6] v3.3.0 Former-commit-id: 25fd5e0b3997230e5bedfc25c7c8fd42cac1883e --- build/Build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Build.bat b/build/Build.bat index e685375b6..d2eb4d6c8 100644 --- a/build/Build.bat +++ b/build/Build.bat @@ -1,6 +1,6 @@ @ECHO OFF SET version=1.9.4.0 -SET webversion=3.2.9.0 +SET webversion=3.3.0.0 SET webconfigversion=1.1.3.0 ECHO Building ImageProcessor %version%, ImageProcess.Web %webversion% and ImageProcess.Web.Config %webconfigversion%