[f-spot/taglib-metadata] Write to XMP sidecar files.



commit 9d94f96e63bb708d11e06192b3fb63bf749a33a6
Author: Ruben Vermeersch <ruben savanne be>
Date:   Fri Jul 2 19:39:30 2010 +0200

    Write to XMP sidecar files.
    
    Currently only with a GConf option:
    
    	/apps/f-spot/metadata/always_use_sidecar.
    
    RAW files always get sidecars.

 src/Jobs/SyncMetadataJob.cs |    8 +++++++-
 src/Preferences.cs          |    3 +++
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/Jobs/SyncMetadataJob.cs b/src/Jobs/SyncMetadataJob.cs
index 2180160..9e05804 100644
--- a/src/Jobs/SyncMetadataJob.cs
+++ b/src/Jobs/SyncMetadataJob.cs
@@ -66,7 +66,13 @@ namespace FSpot.Jobs {
                 tag.Software = FSpot.Defines.PACKAGE + " version " + FSpot.Defines.VERSION;
 
                 Hyena.Log.Information (photo.DefaultVersion.Uri);
-                metadata.Save ();
+                if (Preferences.Get<bool> (Preferences.METADATA_ALWAYS_USE_SIDECAR) || !metadata.Writeable) {
+                    var sidecar_res = new GIOTagLibFileAbstraction () { Uri = photo.DefaultVersion.Uri.ReplaceExtension (".xmp") };
+
+                    metadata.SaveXmpSidecar (sidecar_res);
+                } else {
+                    metadata.Save ();
+                }
             }
         }
     }
diff --git a/src/Preferences.cs b/src/Preferences.cs
index a769000..8d7d5d1 100644
--- a/src/Preferences.cs
+++ b/src/Preferences.cs
@@ -72,6 +72,8 @@ namespace FSpot
 
 		public const string METADATA_EMBED_IN_IMAGE = APP_FSPOT + "metadata/embed_in_image";
 
+		public const string METADATA_ALWAYS_USE_SIDECAR = APP_FSPOT + "metadata/always_use_sidecar";
+
 		public const string EDIT_REDEYE_THRESHOLD = APP_FSPOT + "edit/redeye_threshold";
 		public const string EDIT_CREATE_XCF_VERSION = APP_FSPOT + "edit/create_xcf";
 
@@ -113,6 +115,7 @@ namespace FSpot
 				return 0;
 					
 			case METADATA_EMBED_IN_IMAGE:
+			case METADATA_ALWAYS_USE_SIDECAR:
 			case MAIN_WINDOW_MAXIMIZED:
 			case GROUP_ADAPTOR_ORDER_ASC:
 				return false;



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