f-spot r4190 - trunk/extensions/DevelopInUFraw



Author: sdelcroix
Date: Fri Jul 18 11:57:08 2008
New Revision: 4190
URL: http://svn.gnome.org/viewvc/f-spot?rev=4190&view=rev

Log:
let the user pick defaults while batch developping. patch from pmjdebruijn


Modified:
   trunk/extensions/DevelopInUFraw/DevelopInUFRaw.addin.xml
   trunk/extensions/DevelopInUFraw/DevelopInUFRaw.cs

Modified: trunk/extensions/DevelopInUFraw/DevelopInUFRaw.addin.xml
==============================================================================
--- trunk/extensions/DevelopInUFraw/DevelopInUFRaw.addin.xml	(original)
+++ trunk/extensions/DevelopInUFraw/DevelopInUFRaw.addin.xml	Fri Jul 18 11:57:08 2008
@@ -1,6 +1,6 @@
 <Addin namespace="FSpot"
 	id="DevelopInUFraw"
-	version="0.4.4.101"
+	version="0.4.4.102"
 	name="DevelopInUFRaw"
 	description="Develop the image in UFRaw, saves the result as a new version\n\nNote: Require ufraw 0.13 or CVS version newer than 2007-09-06 !!!"
 	author="Stephane Delcroix"

Modified: trunk/extensions/DevelopInUFraw/DevelopInUFRaw.cs
==============================================================================
--- trunk/extensions/DevelopInUFraw/DevelopInUFRaw.cs	(original)
+++ trunk/extensions/DevelopInUFraw/DevelopInUFRaw.cs	Fri Jul 18 11:57:08 2008
@@ -98,10 +98,6 @@
 			System.Uri developed = GetUriForVersionName (p, name);
 			string idfile = "";
 
-			if (new Gnome.Vfs.Uri (Path.ChangeExtension (raw.Uri.ToString (), ".ufraw")).Exists) {
-				// We found an ID file, use that instead of the raw file
-				idfile = "--conf=" + Path.ChangeExtension (raw.Uri.LocalPath, ".ufraw");
-			}
 
 			if (ufraw_jpeg_quality < 1 || ufraw_jpeg_quality > 100) {
 				Log.Debug ("Invalid JPEG quality specified, defaulting to quality 98");
@@ -112,9 +108,17 @@
 			switch (executable) {
 				case "ufraw":
 					args += ufraw_args;
+					if (new Gnome.Vfs.Uri (Path.ChangeExtension (raw.Uri.ToString (), ".ufraw")).Exists) {
+						// We found an ID file, use that instead of the raw file
+						idfile = "--conf=" + Path.ChangeExtension (raw.Uri.LocalPath, ".ufraw");
+					}
 					break;
 				case "ufraw-batch":
 					args += ufraw_batch_args;
+					if (new Gnome.Vfs.Uri (Path.Combine (FSpot.Global.BaseDirectory, "batch.ufraw")).Exists) {
+						// We found an ID file, use that instead of the raw file
+						idfile = "--conf=" + Path.Combine (FSpot.Global.BaseDirectory, "batch.ufraw");
+					}
 					break;
 			}
 
@@ -133,9 +137,12 @@
 			}
 
 			if (new Gnome.Vfs.Uri (Path.ChangeExtension (developed.ToString (), ".ufraw")).Exists) {
-				if (new Gnome.Vfs.Uri (Path.ChangeExtension (raw.Uri.ToString (), ".ufraw")).Exists) {
-					File.Delete (Path.ChangeExtension (raw.Uri.LocalPath, ".ufraw"));
-				}
+				// We save our own copy of the last ufraw settings, as ufraw can overwrite it's own last used settings outside f-spot
+				File.Delete (Path.Combine (FSpot.Global.BaseDirectory, "batch.ufraw"));
+				File.Copy (Path.ChangeExtension (developed.LocalPath, ".ufraw"), Path.Combine (FSpot.Global.BaseDirectory, "batch.ufraw"));
+
+				// Rename the ufraw file to match the original RAW filename, instead of the (Developed In UFRaw) filename
+				File.Delete (Path.ChangeExtension (raw.Uri.LocalPath, ".ufraw"));
 				File.Move (Path.ChangeExtension (developed.LocalPath, ".ufraw"), Path.ChangeExtension (raw.Uri.LocalPath, ".ufraw"));
 			}
 



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