diff --git a/src/ImageProcessor.Web/Caching/CachedImage.cs b/src/ImageProcessor.Web/Caching/CachedImage.cs
index d51fb549e..7d01c168a 100644
--- a/src/ImageProcessor.Web/Caching/CachedImage.cs
+++ b/src/ImageProcessor.Web/Caching/CachedImage.cs
@@ -22,8 +22,8 @@ namespace ImageProcessor.Web.Caching
///
/// The value of the cached image.
///
- ///
- /// The maximum age in days cached image.
+ ///
+ /// The max age of the cached image.
///
///
/// The last write time of the cached image.
@@ -45,7 +45,7 @@ namespace ImageProcessor.Web.Caching
public string Path { get; set; }
///
- /// The maximum age of the cached image in days.
+ /// Gets or sets the maximum age of the cached image in days.
///
public int MaxAge { get; set; }
diff --git a/src/ImageProcessor.Web/Caching/DiskCache.cs b/src/ImageProcessor.Web/Caching/DiskCache.cs
index fc684f0ca..f7c0e6dac 100644
--- a/src/ImageProcessor.Web/Caching/DiskCache.cs
+++ b/src/ImageProcessor.Web/Caching/DiskCache.cs
@@ -147,7 +147,7 @@ namespace ImageProcessor.Web.Caching
{
if (PersistantDictionary.Instance.TryGetValue(key, out cachedImage))
{
- // Can't check the last write time so Check to see if the cached image is set to expire
+ // Can't check the last write time so check to see if the cached image is set to expire
// or if the max age is different.
if (cachedImage.ExpiresUtc < DateTime.UtcNow.AddDays(-MaxFileCachedDuration)
|| cachedImage.MaxAge != MaxFileCachedDuration)
@@ -161,11 +161,9 @@ namespace ImageProcessor.Web.Caching
return false;
}
- else
- {
- // Nothing in the cache so we should return true.
- return true;
- }
+
+ // Nothing in the cache so we should return true.
+ return true;
}
FileInfo imageFileInfo = new FileInfo(imagePath);
@@ -271,10 +269,11 @@ namespace ImageProcessor.Web.Caching
groupCount -= 1;
}
}
- catch (Exception)
+ catch (Exception ex)
{
// Do Nothing, skip to the next.
- // TODO: Should we handle this?
+ // TODO: Should we handle this?
+ throw ex;
continue;
}
}
diff --git a/src/ImageProcessor.Web/Caching/PersistantDictionary.cs b/src/ImageProcessor.Web/Caching/PersistantDictionary.cs
index 1bf33387b..9c76f8ca1 100644
--- a/src/ImageProcessor.Web/Caching/PersistantDictionary.cs
+++ b/src/ImageProcessor.Web/Caching/PersistantDictionary.cs
@@ -141,8 +141,9 @@ namespace ImageProcessor.Web.Caching
return SQLContext.AddImage(key, cachedImage);
}
- catch (Exception)
+ catch (Exception ex)
{
+ throw ex;
return false;
}
}
diff --git a/src/ImageProcessor.Web/Caching/SQLContext.cs b/src/ImageProcessor.Web/Caching/SQLContext.cs
index 773073da9..d6c9a3b16 100644
--- a/src/ImageProcessor.Web/Caching/SQLContext.cs
+++ b/src/ImageProcessor.Web/Caching/SQLContext.cs
@@ -129,8 +129,9 @@ namespace ImageProcessor.Web.Caching
return true;
}
- catch (Exception)
+ catch (Exception ex)
{
+ throw ex;
return false;
}
}
@@ -167,8 +168,9 @@ namespace ImageProcessor.Web.Caching
return true;
}
- catch (Exception)
+ catch (Exception ex)
{
+ throw ex;
return false;
}
}
@@ -211,8 +213,9 @@ namespace ImageProcessor.Web.Caching
return dictionary;
}
- catch (Exception)
+ catch (Exception ex)
{
+ throw ex;
return new Dictionary();
}
}
diff --git a/src/ImageProcessor.Web/HttpModules/ImageProcessingModule.cs b/src/ImageProcessor.Web/HttpModules/ImageProcessingModule.cs
index ba1e6a1c3..1ef7908c0 100644
--- a/src/ImageProcessor.Web/HttpModules/ImageProcessingModule.cs
+++ b/src/ImageProcessor.Web/HttpModules/ImageProcessingModule.cs
@@ -139,7 +139,7 @@ namespace ImageProcessor.Web.HttpModules
.AutoProcess().Save(cachedPath);
// Ensure that the LastWriteTime property of the source and cached file match.
- DateTime dateTime = DiskCache.SetCachedLastWriteTime(path, cachedPath, isRemote);
+ DateTime dateTime = DiskCache.SetCachedLastWriteTime(path, cachedPath, true);
// Add to the cache.
DiskCache.AddImageToCache(cachedPath, dateTime);
@@ -158,7 +158,7 @@ namespace ImageProcessor.Web.HttpModules
imageFactory.Load(fullPath).AutoProcess().Save(cachedPath);
// Ensure that the LastWriteTime property of the source and cached file match.
- DateTime dateTime = DiskCache.SetCachedLastWriteTime(path, cachedPath, isRemote);
+ DateTime dateTime = DiskCache.SetCachedLastWriteTime(path, cachedPath, false);
// Add to the cache.
DiskCache.AddImageToCache(cachedPath, dateTime);
diff --git a/src/ImageProcessor.sln b/src/ImageProcessor.sln
index 8fee0f88c..3c1c28997 100644
--- a/src/ImageProcessor.sln
+++ b/src/ImageProcessor.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Express 2012 for Web
+# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor", "ImageProcessor\ImageProcessor.csproj", "{3B5DD734-FB7A-487D-8CE6-55E7AF9AEA7E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test\Test.csproj", "{30327C08-7574-4D7E-AC95-6A58753C6855}"
@@ -13,10 +13,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web.Tests", "Web.Test\Web.T
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C427A497-74DC-49B1-8420-D6E68354F29B}"
ProjectSection(SolutionItems) = preProject
+ ImageProcessor.vsmdi = ImageProcessor.vsmdi
Local.testsettings = Local.testsettings
EndProjectSection
EndProject
Global
+ GlobalSection(TestCaseManagementSettings) = postSolution
+ CategoryFile = ImageProcessor.vsmdi
+ EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
All|Any CPU = All|Any CPU
All|Mixed Platforms = All|Mixed Platforms
diff --git a/src/ImageProcessor.vsmdi b/src/ImageProcessor.vsmdi
new file mode 100644
index 000000000..0fb02c69d
--- /dev/null
+++ b/src/ImageProcessor.vsmdi
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Test/Test/Views/Home/Index.cshtml b/src/Test/Test/Views/Home/Index.cshtml
index 05b7a8885..bf32df04f 100644
--- a/src/Test/Test/Views/Home/Index.cshtml
+++ b/src/Test/Test/Views/Home/Index.cshtml
@@ -90,7 +90,7 @@
Remote
-

+ @*

*@