[tracker/writeback] Fixed the writeback module for XMP, now exiftool shows the change
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/writeback] Fixed the writeback module for XMP, now exiftool shows the change
- Date: Wed, 18 Nov 2009 12:31:56 +0000 (UTC)
commit b35323b4a36aab823d6b17d480dc9c5fdfb68e25
Author: Philip Van Hoof <philip codeminded be>
Date: Wed Nov 18 13:30:23 2009 +0100
Fixed the writeback module for XMP, now exiftool shows the change
src/tracker-writeback/tracker-writeback-xmp.c | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-xmp.c b/src/tracker-writeback/tracker-writeback-xmp.c
index 0853ba3..6c4a156 100644
--- a/src/tracker-writeback/tracker-writeback-xmp.c
+++ b/src/tracker-writeback/tracker-writeback-xmp.c
@@ -91,6 +91,7 @@ tracker_writeback_xmp_update_file_metadata (TrackerWritebackFile *writeback_file
guint n;
XmpFilePtr xmp_files;
XmpPtr xmp;
+ /* gboolean debug = TRUE; */
file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
@@ -129,19 +130,39 @@ tracker_writeback_xmp_update_file_metadata (TrackerWritebackFile *writeback_file
return FALSE;
}
+ /* if (debug) {
+ XmpStringPtr str = xmp_string_new();
+ g_print ("\nBEFORE: ---- \n");
+ xmp_serialize_and_format(xmp, str, 0, 0, "\n", "\t", 1);
+ printf ("%s\n", xmp_string_cstr (str));
+ xmp_string_free (str);
+ g_print ("\nAFTER: ---- \n");
+ } */
+
for (n = 0; n < values->len; n++) {
const GStrv row = g_ptr_array_index (values, n);
if (g_strcmp0 (row[1], TRACKER_NIE_PREFIX "title") == 0) {
xmp_delete_property (xmp, NS_EXIF, "Title");
xmp_set_property(xmp, NS_EXIF, "Title", row[2], 0);
+
+ /* I have no idea why I have to set these, but without
+ * it seems that exiftool doesn't see the change */
+ xmp_set_array_item(xmp, NS_DC, "title", 0, row[2], 0);
+ xmp_set_array_item(xmp, NS_DC, "title", 1, row[2], 0);
+
}
/* TODO: Add more */
}
- /* I don't know why, but it looks like it ain't being written to the
- * file at all :( */
+ /* if (debug) {
+ XmpStringPtr str = xmp_string_new();
+ xmp_serialize_and_format(xmp, str, 0, 0, "\n", "\t", 1);
+ printf ("%s\n", xmp_string_cstr (str));
+ xmp_string_free (str);
+ g_print ("\n : ---- \n");
+ } */
if (xmp_files_can_put_xmp(xmp_files, xmp)) {
xmp_files_put_xmp(xmp_files, xmp);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]