[gthumb] Read/write comment date in xmp date field only, bug 519433



commit a90d85b2bc0339a93a3bc8ca32e4f17935c36716
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Sat May 30 09:21:47 2009 -0400

    Read/write comment date in xmp date field only, bug 519433
    
    Eliminates unwanted exif dates from comments.
---
 libgthumb/comments.c       |   20 ++++++++------------
 libgthumb/gth-exif-utils.c |    9 ---------
 2 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/libgthumb/comments.c b/libgthumb/comments.c
index d91c264..566b1ad 100644
--- a/libgthumb/comments.c
+++ b/libgthumb/comments.c
@@ -372,18 +372,14 @@ load_comment_from_metadata (const char *uri)
         g_slist_foreach (metadata_list, (GFunc) g_free, NULL);
         g_slist_free (metadata_list);
 
-	/* Only load the metadata time if the metadata contained useful comments,
-	   location data, or keywords. Almost all photos contain date metadata, so
-	   we do not want to crowd the comment display with date metadata unless
-	   it seems to be intentionally linked with other metadata. This may
-	   be a matter for further consideration. */
-	if ((data->comment != NULL) ||
-            (data->place != NULL) ||
-	    (data->keywords)) {
-	        metadata_time = get_metadata_time_from_fd (file, TAG_NAME_SETS[COMMENT_DATE_TAG_NAMES]);
-        	if (metadata_time > (time_t) 0)
-                	data->time = metadata_time;
-	} else {
+	metadata_time = get_metadata_time_from_fd (file, TAG_NAME_SETS[COMMENT_DATE_TAG_NAMES]);
+	if (metadata_time > (time_t) 0)
+		data->time = metadata_time;
+
+	if ((data->comment == NULL) &&
+            (data->place == NULL) &&
+	    (data->keywords == NULL) &&
+	    (data->time <= 0)) {
 		/* Nothing useful was found. Return NULL. */
 		comment_data_free (data);	
 		data = NULL;
diff --git a/libgthumb/gth-exif-utils.c b/libgthumb/gth-exif-utils.c
index 3ddb476..56561b4 100644
--- a/libgthumb/gth-exif-utils.c
+++ b/libgthumb/gth-exif-utils.c
@@ -42,16 +42,7 @@
 /* When reading / writing comment dates, we use a slightly different
    set of tags than for date sorting. */
 const char *_COMMENT_DATE_TAG_NAMES[] = {
-        "Exif.Image.DateTime",
-        "Xmp.exif.DateTime",
-        "Exif.Photo.DateTimeOriginal",
-        "Xmp.exif.DateTimeOriginal",
-        "Exif.Photo.DateTimeDigitized",
-        "Xmp.exif.DateTimeDigitized",
 	"Xmp.xmp.CreateDate",
-        "Xmp.photoshop.DateCreated",
-	"Xmp.xmp.ModifyDate",
-	"Xmp.xmp.MetadataDate",
 	NULL };
 
 const char *_SORTING_DATE_TAG_NAMES[] = {



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