From a02996ba570960d38101472f5434f5653904b5c9 Mon Sep 17 00:00:00 2001 From: Kenny Burns Date: Tue, 1 Jul 2014 15:46:35 +0100 Subject: [PATCH 1/8] Minor update to DiskCache to prevent unauthorized permission issue over UNC share Former-commit-id: 008c93864acf43615d07e608a5193a696449ac2f --- .../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 7d4150f451..4210706124 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 96ab24edc5d073b43272c9ef6e6a2e8e1263ab63 Mon Sep 17 00:00:00 2001 From: Kenny Burns Date: Tue, 1 Jul 2014 15:51:43 +0100 Subject: [PATCH 2/8] Revert AbsoluteCachePath back to original (private) Former-commit-id: 558d3c9b5266e63f50efbd43b851996e0a834b0b --- 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 4210706124..1cdcfcb2f7 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 c3e8f03f5e20a10f14507c7d17d43caa3de4c9d5 Mon Sep 17 00:00:00 2001 From: James South Date: Tue, 1 Jul 2014 22:42:16 +0100 Subject: [PATCH 3/8] v1.9.4, v3.2.9, v1.1.3 Former-commit-id: bbdf7f4950783b00d95a2c52b2f0fce05d4f4843 --- 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 94f43b25c9..e685375b62 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 cb27a3fb29..b3105cd503 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 5e640a422d..e706fbf27b 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 c2ed6d5a1a..84b0a6f96e 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 c9d6a7da89..6fb6fd2bdb 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 cad554bb4a..1bd78044d2 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 1cdcfcb2f7..57c29f3eb3 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 0000000000..07c47e522d --- /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 23cc45e967..c2a7c9403a 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 e8c655990f..e09d25366f 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 bea6c1401b..30065502cd 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 baf76a4331cece4a856ea97a3d2dd40b82048503 Mon Sep 17 00:00:00 2001 From: James South Date: Fri, 1 Aug 2014 16:11:17 +0100 Subject: [PATCH 4/8] Fixing issue #65 Former-commit-id: 1d84cf69bee6805dadd0a2d46639d04149c10316 --- .../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 57c29f3eb3..c046cfd8ac 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 22c03bef7e..8bf539b548 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 e09d25366f..831e5543e4 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 616093ef4473521ad677b05a7d3f6c54ca850112 Mon Sep 17 00:00:00 2001 From: James South Date: Fri, 1 Aug 2014 16:12:21 +0100 Subject: [PATCH 5/8] Preventing disposal of semaphore objects until app end. Former-commit-id: 293f8b1f02b669cff86f5143ead8b6fddbdceaea --- .../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 8bf539b548..2890629651 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 0585e992c77f74dc9c3fd3cbe1c3cfb22adc232e Mon Sep 17 00:00:00 2001 From: James South Date: Tue, 5 Aug 2014 16:43:02 +0100 Subject: [PATCH 6/8] v1.9.5 Former-commit-id: 422cddce7a0fd914f0347b1ee8ae32bc6636f0f6 --- src/ImageProcessor/ImageProcessor.csproj | 1 - src/ImageProcessor/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ImageProcessor/ImageProcessor.csproj b/src/ImageProcessor/ImageProcessor.csproj index 026c166c4b..8719e3c857 100644 --- a/src/ImageProcessor/ImageProcessor.csproj +++ b/src/ImageProcessor/ImageProcessor.csproj @@ -52,7 +52,6 @@ - diff --git a/src/ImageProcessor/Properties/AssemblyInfo.cs b/src/ImageProcessor/Properties/AssemblyInfo.cs index 30065502cd..39cdaa4067 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.4.0")] -[assembly: AssemblyFileVersion("1.9.4.0")] +[assembly: AssemblyVersion("1.9.5.0")] +[assembly: AssemblyFileVersion("1.9.5.0")] From a5678b0a25ca7c62511b0c3d6592475f8d7e2674 Mon Sep 17 00:00:00 2001 From: James South Date: Tue, 5 Aug 2014 16:43:27 +0100 Subject: [PATCH 7/8] GFW is so lame sometimes... Former-commit-id: b983b25486666bb3e429020c0abf4299ca3f7d87 --- build/Build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Build.bat b/build/Build.bat index d2eb4d6c88..09aff3d866 100644 --- a/build/Build.bat +++ b/build/Build.bat @@ -1,5 +1,5 @@ @ECHO OFF -SET version=1.9.4.0 +SET version=1.9.5.0 SET webversion=3.3.0.0 SET webconfigversion=1.1.3.0 From 0a87b8e41979512973e7275469534ec6348599d8 Mon Sep 17 00:00:00 2001 From: michael-mason Date: Tue, 2 Sep 2014 16:35:28 +1000 Subject: [PATCH 8/8] fix for allowing the loading of mac tiffs Former-commit-id: 0a8f28fb2db6dd5152d512719db899f5c692e621 --- src/ImageProcessor/Imaging/Formats/TiffFormat.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageProcessor/Imaging/Formats/TiffFormat.cs b/src/ImageProcessor/Imaging/Formats/TiffFormat.cs index e761bc4b3d..59229dd88b 100644 --- a/src/ImageProcessor/Imaging/Formats/TiffFormat.cs +++ b/src/ImageProcessor/Imaging/Formats/TiffFormat.cs @@ -29,8 +29,8 @@ namespace ImageProcessor.Imaging.Formats { return new[] { - new byte[] { 73, 73, 42 }, - new byte[] { 77, 77, 42 } + new byte[] { 73, 73, 42, 0 }, + new byte[] { 77, 77, 0, 42 } }; } }