fixes to original export



This is a bit scary since I know a heck of C#, but here's a patch that
fixes two things. 

      * Image and comment filename numbering needs to start from 1, not
        0 for original.
      * Photo comments get exported.
      * The Gallery name gets exported.

cheers

-- 
Jakub Steiner <jimmac novell com>
Novell, Inc.
Index: src/FolderExport.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/FolderExport.cs,v
retrieving revision 1.10
diff -u -r1.10 FolderExport.cs
--- src/FolderExport.cs	3 Jun 2005 09:54:13 -0000	1.10
+++ src/FolderExport.cs	19 Jul 2005 19:17:30 -0000
@@ -437,7 +437,7 @@
 		
 		protected override string ImageName (int photo_index)
 		{
-			return String.Format ("img-{0}.jpg", photo_index);
+			return String.Format ("img-{0}.jpg", photo_index + 1);
 		}
 
 		private string AlternateName (int photo_index, string extention) 
@@ -464,10 +464,16 @@
 			} 
 		}
 
+		private string CommentName (int photo_index)
+		{
+			return String.Format ("img-{0}.txt", photo_index + 1);
+		}
+
 		private void CreateComments(string photo_path, int photo_index)
 		{
-			StreamWriter comment = File.CreateText(SubdirPath  ("comments", "img-" + photo_index + ".txt"));
-			comment.WriteLine("<span>image " + photo_index + "</span>\n");
+			StreamWriter comment = File.CreateText(SubdirPath  ("comments", CommentName (photo_index)));
+			comment.Write("<span>image " + photo_index + "</span> ");
+			comment.Write (collection [photo_index].Description + "\n");
 			comment.Close();
 		}
 
@@ -521,6 +527,7 @@
 		private void CreateInfo()
 		{
 			StreamWriter info = File.CreateText(Path.Combine (gallery_path, "info.txt"));
+			info.WriteLine("name|" + gallery_name);
 			info.WriteLine("date|" + collection [0].Time.Date.ToString ("dd.MM.yyyy"));
 			info.Close();
 		}


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