From 49963941a753bc467e4e0f605fce13babeed76d3 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: 0c5c25e5077d14477eb66d7177cb5e6535b1d673 --- .../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 92f619c6175839d68ada2196d3f0f164eb4da347 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: 428cdb57c1de32d6ebd3c86af3425dc3fd9636ef --- 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 ce09a2833c138fa58d0b0aeb9695c7f61e3387c8 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: c08a514f056f8b42b95dcef2065b095e014da5f9 --- 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 70aa9a5f2ff2965752d87eaee1364ba41c60d735 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: 33e7712572e28ccdda8a62d54c05f257074ec099 --- .../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 f8746963d0ec66f8536f4ddc0a27f51aa54e3f27 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: 298645dd20ba8d487e09d2e5aec20216f353ecef --- .../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 0da9dec3ba646e4d2490aca4208f671c14a9c7ff 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: 1b4bdf1c2fdced3a0049bed0119d2bd140969179 --- 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 026c166c4..8719e3c85 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 30065502c..39cdaa406 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 b62307f6489c4f2470d64187bb928436ec1062f4 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: 749cd4aa2bcde40858f7acc176732a94dbb38c3f --- build/Build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Build.bat b/build/Build.bat index d2eb4d6c8..09aff3d86 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 c594ab05d86628244a7dac04e44b2b6aa90fbcb4 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: de78a6432aff5284ac8eda35a9b14176c97c61a2 --- 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 e761bc4b3..59229dd88 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 } }; } }