gthumb r2209 - in trunk: . libgthumb
- From: mjc svn gnome org
- To: svn-commits-list gnome org
- Subject: gthumb r2209 - in trunk: . libgthumb
- Date: Mon, 21 Jan 2008 02:06:25 +0000 (GMT)
Author: mjc
Date: Mon Jan 21 02:06:24 2008
New Revision: 2209
URL: http://svn.gnome.org/viewvc/gthumb?rev=2209&view=rev
Log:
2008-01-20 Michael J. Chudobiak <mjc svn gnome org>
* libgthumb/gth-exif-utils.c: (get_metadata_time_from_fd):
Correct the counting of elements in DATE_TAG_NAMES.
Delete the unused get_exif_time function.
Modified:
trunk/ChangeLog
trunk/libgthumb/gth-exif-utils.c
Modified: trunk/libgthumb/gth-exif-utils.c
==============================================================================
--- trunk/libgthumb/gth-exif-utils.c (original)
+++ trunk/libgthumb/gth-exif-utils.c Mon Jan 21 02:06:24 2008
@@ -39,7 +39,7 @@
"DateTimeOriginal",
"exif.DateTimeOriginal",
"DateTimeDigitized",
- "exif.DateTimeDigitized"
+ "exif.DateTimeDigitized",
"DateTime",
"exif.DateTime",
"photoshop.DateCreated" };
@@ -147,42 +147,6 @@
}
-static time_t
-get_exif_time (const char *uri)
-{
- char *local_file = NULL;
- char date_string[64] = {0};
- time_t time = 0;
-
- if (uri == NULL)
- return (time_t) 0;
-
- local_file = get_cache_filename_from_uri (uri);
- if (local_file == NULL)
- return (time_t) 0;
-
- gth_minimal_exif_tag_read (local_file, EXIF_TAG_DATE_TIME, date_string, 20);
- time = exif_string_to_time_t (date_string);
-
- if (time <= (time_t) 0) {
- gth_minimal_exif_tag_read (local_file, EXIF_TAG_DATE_TIME_ORIGINAL, date_string, 20);
- time = exif_string_to_time_t (date_string);
- }
-
- if (time <= (time_t) 0) {
- gth_minimal_exif_tag_read (local_file, EXIF_TAG_DATE_TIME_DIGITIZED, date_string, 20);
- time = exif_string_to_time_t (date_string);
- }
-
- g_free (local_file);
-
- if (time < (time_t) 0)
- return (time_t) 0;
- else
- return time;
-}
-
-
gint
metadata_search (GthMetadata *a,
char *b)
@@ -194,13 +158,11 @@
time_t
get_metadata_time_from_fd (FileData *fd)
{
- int i, len;
+ int i;
char *date = NULL;
time_t result = 0;
- len = (sizeof (DATE_TAG_NAMES) / sizeof (DATE_TAG_NAMES[0])) + 1;
-
- for (i = 0; i < len && date == NULL; i++) {
+ for (i = 0; (i < G_N_ELEMENTS (DATE_TAG_NAMES)) && (date == NULL); i++) {
GList *search_result = g_list_find_custom (fd->metadata, DATE_TAG_NAMES[i], (GCompareFunc)metadata_search);
if (search_result != NULL) {
GthMetadata *md_entry = search_result->data;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]