f-spot r4614 - in trunk: . src/Core



Author: sdelcroix
Date: Mon Nov 24 11:48:28 2008
New Revision: 4614
URL: http://svn.gnome.org/viewvc/f-spot?rev=4614&view=rev

Log:
create md5 on SaveVersion

2008-11-24  Lorenzo Milesi  <maxxer yetopen it>

	* src/Core/Photo.cs: ensure md5 is hashed when creating new version
	with SaveVersion.

Modified:
   trunk/ChangeLog
   trunk/src/Core/Photo.cs

Modified: trunk/src/Core/Photo.cs
==============================================================================
--- trunk/src/Core/Photo.cs	(original)
+++ trunk/src/Core/Photo.cs	Mon Nov 24 11:48:28 2008
@@ -359,6 +359,7 @@
 					using (Stream stream = System.IO.File.OpenWrite (version_path)) {
 						img.Save (buffer, stream);
 					}
+					(GetVersion (version) as PhotoVersion).MD5Sum = GenerateMD5 (VersionUri (version));
 					FSpot.ThumbnailGenerator.Create (version_path).Dispose ();
 					DefaultVersionId = version;
 				} catch (System.Exception e) {
@@ -444,18 +445,7 @@
 					Gnome.Vfs.XferOverwriteMode.Abort,
 					delegate (Gnome.Vfs.XferProgressInfo info) {return 1;});
 	
-	//			Mono.Unix.Native.Stat stat;
-	//			int stat_err = Mono.Unix.Native.Syscall.stat (original_path, out stat);
-	//			File.Copy (original_path, new_path);
 				FSpot.ThumbnailGenerator.Create (new_uri).Dispose ();
-	//			
-	//			if (stat_err == 0) 
-	//				try {
-	//					Mono.Unix.Native.Syscall.chown(new_path, Mono.Unix.Native.Syscall.getuid (), stat.st_gid);
-	//				} catch (Exception) {}
-	//
-			} else {
-				md5_sum = Photo.GenerateMD5 (new_uri);
 			}
 			highest_version_id ++;
 



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