diff --git a/src/ImageProcessor.Web/Caching/DiskCache.cs b/src/ImageProcessor.Web/Caching/DiskCache.cs index 6a1f1b841..067dfec31 100644 --- a/src/ImageProcessor.Web/Caching/DiskCache.cs +++ b/src/ImageProcessor.Web/Caching/DiskCache.cs @@ -283,7 +283,7 @@ namespace ImageProcessor.Web.Caching { // Check to see if the last write time is different of whether the // cached image is set to expire or if the max age is different. - if (imageFileInfo.LastWriteTimeUtc != cachedImage.LastWriteTimeUtc + if (!this.RoughDateTimeCompare(imageFileInfo.LastWriteTimeUtc, cachedImage.LastWriteTimeUtc) || cachedImage.ExpiresUtc < DateTime.UtcNow.AddDays(-MaxFileCachedDuration) || cachedImage.MaxAge != MaxFileCachedDuration) { @@ -461,6 +461,31 @@ namespace ImageProcessor.Web.Caching return match.Success ? match.Value : string.Empty; } + + /// + /// The rough date time compare. + /// + /// + /// The first. + /// + /// + /// The second. + /// + /// + /// The true if the DateTimes roughly compare; otherwise, false. + /// + private bool RoughDateTimeCompare(DateTime first, DateTime second) + { + var x = first.ToString(CultureInfo.InvariantCulture); + var y = second.ToString(CultureInfo.InvariantCulture); + + if (first.ToString(CultureInfo.InvariantCulture) == second.ToString(CultureInfo.InvariantCulture)) + { + return true; + } + + return false; + } #endregion #endregion } diff --git a/src/ImageProcessor.Web/Properties/AssemblyInfo.cs b/src/ImageProcessor.Web/Properties/AssemblyInfo.cs index d96f29a4a..8f583b9f9 100644 --- a/src/ImageProcessor.Web/Properties/AssemblyInfo.cs +++ b/src/ImageProcessor.Web/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.2.0.0")] -[assembly: AssemblyFileVersion("2.2.0.0")] +[assembly: AssemblyVersion("2.2.0.1")] +[assembly: AssemblyFileVersion("2.2.0.1")] diff --git a/src/Nuget/ImageProcessor.Web.2.2.0.1.nupkg.REMOVED.git-id b/src/Nuget/ImageProcessor.Web.2.2.0.1.nupkg.REMOVED.git-id new file mode 100644 index 000000000..cf985cfa6 --- /dev/null +++ b/src/Nuget/ImageProcessor.Web.2.2.0.1.nupkg.REMOVED.git-id @@ -0,0 +1 @@ +8a3fd4491298fec4626034f03e534caac7f22941 \ No newline at end of file diff --git a/src/Nuget/ImageProcessor.Web.2.2.0.1.nuspec b/src/Nuget/ImageProcessor.Web.2.2.0.1.nuspec new file mode 100644 index 000000000..a315efbfb --- /dev/null +++ b/src/Nuget/ImageProcessor.Web.2.2.0.1.nuspec @@ -0,0 +1,43 @@ + + + + ImageProcessor.Web + 2.2.0.1 + ImageProcessor.Web + James South + James South + http://jimbobsquarepants.github.com/ImageProcessor/ + false + ImageProcessor.Web adds a configurable HttpModule to your website which allows on-the-fly processing of image files. The module also comes with a file and browser based cache that can handle up to 12,960,000 images increasing your processing output and saving precious server memory. + +Methods include; Resize, Rotate, Flip, Crop, Watermark, Filter, Saturation, Brightness, Contrast, Quality, Format, Vignette, and Transparency. + +This package also requires Microsoft.Bcl.Async -pre on .NET 4.0 which will be added in the background on install if applicable. + +If you use ImageProcessor please get in touch via my twitter @james_m_south + + +Feedback is always welcome. + An extension to ImageProcessor that allows on-the-fly processing of image files in an ASP.NET website + Fixed cache bug which caused unneccessary processing of images. + +If upgrading from < 2.2.0.0 You will have to delete your cache if upgrading to this version as the database differs. + James South + en-GB + Image, Imaging, ASP, Performance, Processing, HttpModule, Cache, Resize, Rotate, Flip, Crop, Filter, Effects, Quality, Watermark, Alpha, Vignette, Saturation, Brightness, Contrast, Gif, Jpeg, Bitmap, Png, Fluent + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Test/Test/Web.config b/src/Test/Test/Web.config index 65f962b5a..89f858543 100644 --- a/src/Test/Test/Web.config +++ b/src/Test/Test/Web.config @@ -1,4 +1,4 @@ - + -
-
-
+
+
+
- - - + + + - + - - - - - + + + + + - + - - - - - - + + + + + + - + - - + + - - + + - - + + - - + + - + - + - - + +