gthumb r2205 - in trunk: . libgthumb src



Author: mjc
Date: Sun Jan 20 21:40:51 2008
New Revision: 2205
URL: http://svn.gnome.org/viewvc/gthumb?rev=2205&view=rev

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

        * libgthumb/file-data.c: (file_data_insert_metadata):
        * libgthumb/gth-exif-utils.c: (get_metadata_time_from_fd),
        (get_metadata_time):
        * libgthumb/gth-exif-utils.h:
        * src/catalog-png-exporter.c: (image_loader_done):
        * src/catalog-web-exporter.c: (gth_parsed_doc_print):
        * src/dlg-change-date.c: (exif_time_available), (ok_clicked):
        * src/gth-browser.c: (window_update_statusbar_image_info):
        * src/gth-viewer.c: (viewer_update_statusbar_image_info):
        Added a function called get_metadata_time_from_fd to get the metadata
        time from the FileData in a simpler fashion. The original
        get_metadata_time function will be purged soon.



Modified:
   trunk/ChangeLog
   trunk/libgthumb/file-data.c
   trunk/libgthumb/gth-exif-utils.c
   trunk/libgthumb/gth-exif-utils.h
   trunk/src/catalog-png-exporter.c
   trunk/src/catalog-web-exporter.c
   trunk/src/dlg-change-date.c
   trunk/src/gth-browser.c
   trunk/src/gth-viewer.c

Modified: trunk/libgthumb/file-data.c
==============================================================================
--- trunk/libgthumb/file-data.c	(original)
+++ trunk/libgthumb/file-data.c	Sun Jan 20 21:40:51 2008
@@ -325,7 +325,7 @@
 		return;
 
 	fd->metadata = update_metadata (fd->metadata, fd->path, fd->mime_type);
-	fd->exif_time = get_metadata_time (fd->mime_type, fd->path, fd->metadata);
+	fd->exif_time = get_metadata_time_from_fd (fd);
 	fd->exif_data_loaded = TRUE;
 }
 

Modified: trunk/libgthumb/gth-exif-utils.c
==============================================================================
--- trunk/libgthumb/gth-exif-utils.c	(original)
+++ trunk/libgthumb/gth-exif-utils.c	Sun Jan 20 21:40:51 2008
@@ -192,16 +192,22 @@
 
 
 time_t
+get_metadata_time_from_fd (FileData *fd)
+{
+	return get_metadata_time (fd->mime_type, fd->path, fd->metadata);
+}
+
+
+time_t
 get_metadata_time (const char *mime_type, 
 		   const char *uri,
 		   GList *md)
 {
 	gboolean loaded_metadata = FALSE;
 
-	if (mime_type == NULL)
-		mime_type = get_mime_type (uri);
-
 	if (md == NULL) {
+		if (mime_type == NULL)
+			mime_type = get_mime_type (uri);
 		md = update_metadata (NULL, uri, mime_type);
 		loaded_metadata = TRUE;
 	}

Modified: trunk/libgthumb/gth-exif-utils.h
==============================================================================
--- trunk/libgthumb/gth-exif-utils.h	(original)
+++ trunk/libgthumb/gth-exif-utils.h	Sun Jan 20 21:40:51 2008
@@ -32,6 +32,7 @@
 #include <libexif/exif-utils.h>
 #include "jpegutils/jpeg-data.h"
 #include "typedefs.h"
+#include "file-data.h"
 
 // Return values from gth_minimal_exif_tag_writes() 
 #define PATCH_EXIF_OK               0
@@ -75,6 +76,7 @@
 ExifData     *gth_exif_data_new_from_uri  (const char   *path);
 char *        get_exif_tag                (const char   *filename,
 				           ExifTag       etag);
+time_t        get_metadata_time_from_fd   (FileData     *fd);
 time_t        get_metadata_time           (const char *mime_type,
 					   const char *uri,
 					   GList *md);

Modified: trunk/src/catalog-png-exporter.c
==============================================================================
--- trunk/src/catalog-png-exporter.c	(original)
+++ trunk/src/catalog-png-exporter.c	Sun Jan 20 21:40:51 2008
@@ -1451,7 +1451,7 @@
 
 	/* time in exif tag, if present */
 
-	idata->exif_time = get_metadata_time (NULL, idata->file->path, NULL);
+	idata->exif_time = get_metadata_time_from_fd (idata->file);
 
 	/* thumbnail. */
 	idata->thumb = pixbuf = image_loader_get_pixbuf (iloader);

Modified: trunk/src/catalog-web-exporter.c
==============================================================================
--- trunk/src/catalog-web-exporter.c	(original)
+++ trunk/src/catalog-web-exporter.c	Sun Jan 20 21:40:51 2008
@@ -1803,7 +1803,7 @@
 				struct tm *tp;
 				char s[100];
 
-				t = get_metadata_time (NULL, NULL, idata->src_file->metadata);
+				t = get_metadata_time_from_fd (idata->src_file);
 				if (t != 0) {
 					tp = localtime (&t);
 					strftime (s, 99, DATE_FORMAT, tp);

Modified: trunk/src/dlg-change-date.c
==============================================================================
--- trunk/src/dlg-change-date.c	(original)
+++ trunk/src/dlg-change-date.c	Sun Jan 20 21:40:51 2008
@@ -90,7 +90,7 @@
 
 	fd = data->file_list->data;
 
-	return get_metadata_time (fd->mime_type, fd->path, fd->metadata) != 0;
+	return get_metadata_time_from_fd (fd) != 0;
 }
 
 
@@ -122,7 +122,7 @@
 			mtime = get_file_ctime (fdata->path);
 			comment_time = mtime;
 		} else if (is_active (data->cd_exif_radiobutton)) {
-			mtime = get_metadata_time (fdata->mime_type, fdata->path, fdata->metadata);
+			mtime = get_metadata_time_from_fd (fdata);
 			comment_time = mtime;
 		} else if (is_active (data->cd_adjust_timezone_radiobutton)) {
 			time_t tz;

Modified: trunk/src/gth-browser.c
==============================================================================
--- trunk/src/gth-browser.c	(original)
+++ trunk/src/gth-browser.c	Sun Jan 20 21:40:51 2008
@@ -476,7 +476,7 @@
 		height = 0;
 	}
 
-	timer = get_metadata_time (NULL, NULL, priv->image->metadata);
+	timer = get_metadata_time_from_fd (priv->image);
 	if (timer == 0)
 		timer = priv->image->mtime;
 	tm = localtime (&timer);

Modified: trunk/src/gth-viewer.c
==============================================================================
--- trunk/src/gth-viewer.c	(original)
+++ trunk/src/gth-viewer.c	Sun Jan 20 21:40:51 2008
@@ -606,7 +606,7 @@
 		height = 0;
 	}
 
-	timer = get_metadata_time (NULL, NULL, priv->image->metadata);
+	timer = get_metadata_time_from_fd (priv->image);
 	if (timer == 0)
 		timer = priv->image->mtime;
 	tm = localtime (&timer);



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