gthumb r2236 - in trunk: . libgthumb src



Author: mjc
Date: Wed Jan 30 14:21:32 2008
New Revision: 2236
URL: http://svn.gnome.org/viewvc/gthumb?rev=2236&view=rev

Log:
2008-01-30  Michael J. Chudobiak  <mjc svn gnome org>

        * libgthumb/file-data.c: (free_metadata_entry):
        * libgthumb/gth-exif-utils.c: (get_metadata_string_from_fd):
        * libgthumb/gth-exif-utils.h:
        * libgthumb/gth-exiv2-utils.cpp:
        * libgthumb/gth-gstreamer-utils.c: (add_metadata):
        * src/gth-exif-data-viewer.c: (gth_exif_data_viewer_construct),
        (add_to_exif_display_list), (add_to_display), (update_file_info):
        Store "raw" metadata along with the formatted metadata, so that
        we can (eventually) use the raw data to write metadata into a file.



Modified:
   trunk/ChangeLog
   trunk/libgthumb/file-data.c
   trunk/libgthumb/gth-exif-utils.c
   trunk/libgthumb/gth-exif-utils.h
   trunk/libgthumb/gth-exiv2-utils.cpp
   trunk/libgthumb/gth-gstreamer-utils.c
   trunk/src/gth-exif-data-viewer.c

Modified: trunk/libgthumb/file-data.c
==============================================================================
--- trunk/libgthumb/file-data.c	(original)
+++ trunk/libgthumb/file-data.c	Wed Jan 30 14:21:32 2008
@@ -42,7 +42,8 @@
         if (entry != NULL) {
                 g_free (entry->full_name);
                 g_free (entry->display_name);
-                g_free (entry->value);
+                g_free (entry->formatted_value);
+		g_free (entry->raw_value);
                 g_free (entry);
         }
 }

Modified: trunk/libgthumb/gth-exif-utils.c
==============================================================================
--- trunk/libgthumb/gth-exif-utils.c	(original)
+++ trunk/libgthumb/gth-exif-utils.c	Wed Jan 30 14:21:32 2008
@@ -268,7 +268,7 @@
 		if (search_result != NULL) {
 			GthMetadata *md_entry = search_result->data;
 			g_free (string);
-			string = g_strdup (md_entry->value);
+			string = g_strdup (md_entry->formatted_value);
 		}
 	}
 		

Modified: trunk/libgthumb/gth-exif-utils.h
==============================================================================
--- trunk/libgthumb/gth-exif-utils.h	(original)
+++ trunk/libgthumb/gth-exif-utils.h	Wed Jan 30 14:21:32 2008
@@ -68,7 +68,8 @@
         GthMetadataCategory category;
 	char    *full_name;
         char    *display_name;
-        char    *value;
+        char    *formatted_value;
+	char    *raw_value;
         int      position;
 	gboolean writeable;
 } GthMetadata;

Modified: trunk/libgthumb/gth-exiv2-utils.cpp
==============================================================================
--- trunk/libgthumb/gth-exiv2-utils.cpp	(original)
+++ trunk/libgthumb/gth-exiv2-utils.cpp	Wed Jan 30 14:21:32 2008
@@ -265,8 +265,7 @@
 };
 
 static GthMetadataCategory
-tag_category_exiv2 (const Exiv2::Exifdatum &md,
-	      int     &position)
+tag_category_exiv2 (const Exiv2::Exifdatum &md, int &position)
 {
 	GthMetadataCategory category;
 	int tempCategory;
@@ -334,9 +333,10 @@
 add (GList              *metadata,
      const gchar        *full_name, 
      const gchar        *display_name,
-     const gchar	*value,
+     const gchar	*formatted_value,
+     const gchar	*raw_value,
      GthMetadataCategory category,
-     const int		position)
+     const int		 position)
 {
 	GthMetadata *new_entry;
 
@@ -344,7 +344,8 @@
 	new_entry->category = category;
 	new_entry->full_name = g_strdup (full_name);
 	new_entry->display_name = g_strdup (display_name);
-	new_entry->value = g_strdup (value);	
+	new_entry->formatted_value = g_strdup (formatted_value);
+	new_entry->raw_value = g_strdup (raw_value);
 	new_entry->position = position;
 	new_entry->writeable = TRUE;
 	metadata = g_list_prepend (metadata, new_entry);
@@ -396,7 +397,13 @@
 					short_name << md->tagName();	
 				}
 
-				metadata = add (metadata, md->key().c_str(), short_name.str().c_str(), value.str().c_str(), cat, pos);
+				metadata = add (metadata, 
+						md->key().c_str(), 
+						short_name.str().c_str(), 
+						value.str().c_str(),
+						md->toString().c_str(), 
+						cat, 
+						pos);
 			}
 		}
 
@@ -419,7 +426,13 @@
 				stringstream short_name;
 				short_name << md->tagName();
 
-				metadata = add (metadata, md->key().c_str(), short_name.str().c_str(), value.str().c_str(), cat, 0);
+				metadata = add (metadata, 
+						md->key().c_str(), 
+						short_name.str().c_str(), 
+						value.str().c_str(), 
+						md->toString().c_str(),
+						cat, 
+						0);
 			}
 		}
 
@@ -442,7 +455,13 @@
 				stringstream short_name;
 				short_name << md->groupName() << "." << md->tagName();
 
-				metadata = add (metadata, md->key().c_str(), short_name.str().c_str(), value.str().c_str(), cat, 0);
+				metadata = add (metadata, 
+						md->key().c_str(), 
+						short_name.str().c_str(), 
+						value.str().c_str(), 
+						md->toString().c_str(),
+						cat, 
+						0);
 			}
 		}
 #endif
@@ -487,7 +506,13 @@
 				stringstream short_name;
 				short_name << md->groupName() << "." << md->tagName();
 
-				metadata = add (metadata, md->key().c_str(), short_name.str().c_str(), value.str().c_str(), cat, 0);
+				metadata = add (metadata, 
+						md->key().c_str(), 
+						short_name.str().c_str(), 
+						value.str().c_str(), 
+						md->toString().c_str(),
+						cat, 
+						0);
 			}
 		}
 		Exiv2::XmpParser::terminate();

Modified: trunk/libgthumb/gth-gstreamer-utils.c
==============================================================================
--- trunk/libgthumb/gth-gstreamer-utils.c	(original)
+++ trunk/libgthumb/gth-gstreamer-utils.c	Wed Jan 30 14:21:32 2008
@@ -352,7 +352,8 @@
         	new_entry->category = GTH_METADATA_CATEGORY_GSTREAMER;
 		new_entry->full_name = g_strdup (key);
 		new_entry->display_name = key;
-        	new_entry->value = value;
+        	new_entry->formatted_value = value;
+		new_entry->raw_value = NULL;
 	       	new_entry->position = 0;
 		new_entry->writeable = FALSE;
         	metadata = g_list_prepend (metadata, new_entry);

Modified: trunk/src/gth-exif-data-viewer.c
==============================================================================
--- trunk/src/gth-exif-data-viewer.c	(original)
+++ trunk/src/gth-exif-data-viewer.c	Wed Jan 30 14:21:32 2008
@@ -61,6 +61,7 @@
 	FULL_NAME_COLUMN,
 	DISPLAY_NAME_COLUMN,
 	VALUE_COLUMN,
+	RAW_COLUMN,
 	POS_COLUMN,
 	WRITEABLE_COLUMN,
 	NUM_COLUMNS
@@ -140,7 +141,8 @@
 	edv->priv->image_exif_view = gtk_tree_view_new ();
 	gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (edv->priv->image_exif_view), FALSE);
 	gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (edv->priv->image_exif_view), TRUE);
-	edv->priv->image_exif_model = gtk_tree_store_new (5,
+	edv->priv->image_exif_model = gtk_tree_store_new (6,
+							  G_TYPE_STRING,
 							  G_TYPE_STRING,
 							  G_TYPE_STRING,
 							  G_TYPE_STRING,
@@ -280,7 +282,8 @@
 			  GthMetadataCategory  category,
 			  const char	      *full_name,
 			  const char 	      *display_name,
-			  const char	      *utf8_value,
+			  const char	      *formatted_value,
+			  const char	      *raw_value,
 	 		  int		       position,
 			  gboolean	       writeable)
 {
@@ -295,6 +298,7 @@
 				    FULL_NAME_COLUMN, NULL,
 				    DISPLAY_NAME_COLUMN, _(metadata_category_name[category]),
 				    VALUE_COLUMN, "",
+				    RAW_COLUMN, "",
 				    POS_COLUMN, category,
 				    WRITEABLE_COLUMN, writeable,
 				    -1);
@@ -315,7 +319,8 @@
 	gtk_tree_store_set (edv->priv->image_exif_model, &iter,
 			    FULL_NAME_COLUMN, full_name,
 			    DISPLAY_NAME_COLUMN, display_name,
-			    VALUE_COLUMN, utf8_value,
+			    VALUE_COLUMN, formatted_value,
+			    RAW_COLUMN, raw_value,
 			    POS_COLUMN, position,
 			    WRITEABLE_COLUMN, writeable,
 			    -1);
@@ -330,7 +335,8 @@
 		       		  entry->category,
 				  entry->full_name,
 			  	  entry->display_name,
-				  entry->value,
+				  entry->formatted_value,
+				  entry->raw_value,
 				  entry->position,
 				  entry->writeable);
 }
@@ -376,15 +382,15 @@
 	
 	/**/
 
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Name"), utf8_name, -7, FALSE);
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Path"), utf8_fullname, -6, FALSE);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Name"), utf8_name, NULL, -7, FALSE);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Path"), utf8_fullname, NULL, -6, FALSE);
 
 	if (mime_type_is_image (mime_type))
-		add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Dimensions"), size_txt, -5, FALSE);
+		add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Dimensions"), size_txt, NULL, -5, FALSE);
 
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Size"), file_size_txt, -4, FALSE);
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Modified"), utf8_time_txt, -3, FALSE);
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Type"), mime_type, -2, FALSE);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Size"), file_size_txt, NULL, -4, FALSE);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Modified"), utf8_time_txt, NULL, -3, FALSE);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Type"), mime_type, NULL, -2, FALSE);
 
 	/**/
 



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