Thumbnail generator patch



A small fix to kill a bloody exception.

/L
Index: ThumbnailGenerator.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/ThumbnailGenerator.cs,v
retrieving revision 1.14
diff -u -r1.14 ThumbnailGenerator.cs
--- ThumbnailGenerator.cs	21 May 2005 00:29:17 -0000	1.14
+++ ThumbnailGenerator.cs	14 Aug 2005 18:27:15 -0000
@@ -19,17 +19,17 @@
 		
 		public static bool ThumbnailIsValid (Gdk.Pixbuf thumbnail, System.Uri uri)
 		{
-			bool valid = false;
+			try {
+				if (! System.IO.File.Exists (uri.LocalPath))
+					return false;
 
-			try {			
 				System.DateTime mtime = System.IO.File.GetLastWriteTime (uri.LocalPath);
-				valid  = Gnome.Thumbnail.IsValid (thumbnail, uri.ToString (), mtime);
+				return Gnome.Thumbnail.IsValid (thumbnail, uri.ToString (), mtime);
 			} catch (System.Exception e) {
 				System.Console.WriteLine (e);
-				valid = false;
 			}
 			
-			return valid;
+			return false;
 		}
 
 		public static string ThumbnailPath (System.Uri uri)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]