Revision: 1785
http://geeqie.svn.sourceforge.net/geeqie/?rev=1785&view=rev
Author: nadvornik
Date: 2009-06-30 20:12:28 +0000 (Tue, 30 Jun 2009)
Log Message:
-----------
fixes for a built without Exiv2
don't try to access XMP metadata if not compiled with Exiv2
some metadata options are valid without Exiv2, do not disable them
Modified Paths:
--------------
trunk/src/exif-common.c
trunk/src/exif.c
trunk/src/filedata.c
trunk/src/metadata.c
trunk/src/preferences.c
trunk/src/rcfile.c
Modified: trunk/src/exif-common.c
===================================================================
--- trunk/src/exif-common.c 2009-06-30 19:53:55 UTC (rev 1784)
+++ trunk/src/exif-common.c 2009-06-30 20:12:28 UTC (rev 1785)
@@ -619,9 +619,14 @@
/* CACHE_TYPE_XMP_METADATA file should exist only if the metadata are
* not writable directly, thus it should contain the most up-to-date
version */
+ sidecar_path = NULL;
+
+#ifdef HAVE_EXIV2
+ /* we are not able to handle XMP sidecars without exiv2 */
sidecar_path = cache_find_location(CACHE_TYPE_XMP_METADATA, fd->path);
if (!sidecar_path) sidecar_path = file_data_get_sidecar_path(fd, TRUE);
+#endif
fd->exif = exif_read(fd->path, sidecar_path, fd->modified_xmp);
Modified: trunk/src/exif.c
===================================================================
--- trunk/src/exif.c 2009-06-30 19:53:55 UTC (rev 1784)
+++ trunk/src/exif.c 2009-06-30 20:12:28 UTC (rev 1785)
@@ -1582,13 +1582,13 @@
gboolean exif_write(ExifData *exif)
{
- log_printf("Not compiled with EXIF write support");
+ log_printf("Not compiled with EXIF write support\n");
return FALSE;
}
gboolean exif_write_sidecar(ExifData *exif, gchar *path)
{
- log_printf("Not compiled with EXIF write support");
+ log_printf("Not compiled with EXIF write support\n");
return FALSE;
}
Modified: trunk/src/filedata.c
===================================================================
--- trunk/src/filedata.c 2009-06-30 19:53:55 UTC (rev 1784)
+++ trunk/src/filedata.c 2009-06-30 20:12:28 UTC (rev 1785)
@@ -1949,7 +1949,11 @@
/* If an existing metadata file exists, we will try
writing to
* it's location regardless of the user's preference.
*/
- gchar *metadata_path =
cache_find_location(CACHE_TYPE_XMP_METADATA, fd->path);
+ gchar *metadata_path = NULL;
+#ifdef HAVE_EXIV2
+ /* but ignore XMP if we are not able to write it */
+ metadata_path =
cache_find_location(CACHE_TYPE_XMP_METADATA, fd->path);
+#endif
if (!metadata_path) metadata_path =
cache_find_location(CACHE_TYPE_METADATA, fd->path);
if (metadata_path && !access_file(metadata_path, W_OK))
Modified: trunk/src/metadata.c
===================================================================
--- trunk/src/metadata.c 2009-06-30 19:53:55 UTC (rev 1784)
+++ trunk/src/metadata.c 2009-06-30 20:12:28 UTC (rev 1785)
@@ -457,6 +457,10 @@
g_free(metadata_pathl);
g_free(metadata_path);
}
+
+#ifdef HAVE_EXIV2
+ /* without exiv2: do not delete xmp metadata because we are not able to
convert it,
+ just ignore it */
metadata_path = cache_find_location(CACHE_TYPE_XMP_METADATA, fd->path);
if (metadata_path && (!except || strcmp(metadata_path, except) != 0))
{
@@ -465,6 +469,7 @@
g_free(metadata_pathl);
g_free(metadata_path);
}
+#endif
}
static gboolean metadata_legacy_read(FileData *fd, GList **keywords, gchar
**comment)
Modified: trunk/src/preferences.c
===================================================================
--- trunk/src/preferences.c 2009-06-30 19:53:55 UTC (rev 1784)
+++ trunk/src/preferences.c 2009-06-30 20:12:28 UTC (rev 1785)
@@ -1594,16 +1594,19 @@
vbox = scrolled_notebook_page(notebook, _("Metadata"));
+
+ group = pref_group_new(vbox, FALSE, _("Metadata writing process"),
GTK_ORIENTATION_VERTICAL);
#ifndef HAVE_EXIV2
- gtk_widget_set_sensitive(vbox, FALSE);
+ label = pref_label_new(group, _("Warning: Geeqie is built without
Exiv2. Some options are disabled."));
#endif
-
- group = pref_group_new(vbox, FALSE, _("Metadata writing process"),
GTK_ORIENTATION_VERTICAL);
label = pref_label_new(group, _("Metadata are written in the following
order. The process ends after first success."));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
ct_button = pref_checkbox_new_int(group, _("1) Save metadata in image
files, resp. sidecar files, according to the XMP standard"),
options->metadata.save_in_image_file,
&c_options->metadata.save_in_image_file);
+#ifndef HAVE_EXIV2
+ gtk_widget_set_sensitive(ct_button, FALSE);
+#endif
pref_checkbox_new_int(group, _("2) Save metadata in '.metadata' folder,
local to image folder (non-standard)"),
options->metadata.enable_metadata_dirs,
&c_options->metadata.enable_metadata_dirs);
@@ -1614,6 +1617,9 @@
g_free(text);
group = pref_group_new(vbox, FALSE, _("Step 1: Write to image files"),
GTK_ORIENTATION_VERTICAL);
+#ifndef HAVE_EXIV2
+ gtk_widget_set_sensitive(group, FALSE);
+#endif
hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL,
PREF_PAD_SPACE);
pref_checkbox_link_sensitivity(ct_button, hbox);
@@ -1628,6 +1634,9 @@
options->metadata.confirm_write,
&c_options->metadata.confirm_write);
group = pref_group_new(vbox, FALSE, _("Step 2 and 3: write to Geeqie
private files"), GTK_ORIENTATION_VERTICAL);
+#ifndef HAVE_EXIV2
+ gtk_widget_set_sensitive(group, FALSE);
+#endif
pref_checkbox_new_int(group, _("Use GQview legacy metadata format
(supports only keywords and comments) instead of XMP"),
options->metadata.save_legacy_format,
&c_options->metadata.save_legacy_format);
@@ -1640,8 +1649,11 @@
pref_checkbox_new_int(group, _("Allow keywords to differ only in case"),
options->metadata.keywords_case_sensitive,
&c_options->metadata.keywords_case_sensitive);
- pref_checkbox_new_int(group, _("Write altered image orientation to the
metadata"),
+ ct_button = pref_checkbox_new_int(group, _("Write altered image
orientation to the metadata"),
options->metadata.write_orientation,
&c_options->metadata.write_orientation);
+#ifndef HAVE_EXIV2
+ gtk_widget_set_sensitive(ct_button, FALSE);
+#endif
group = pref_group_new(vbox, FALSE, _("Auto-save options"),
GTK_ORIENTATION_VERTICAL);
Modified: trunk/src/rcfile.c
===================================================================
--- trunk/src/rcfile.c 2009-06-30 19:53:55 UTC (rev 1784)
+++ trunk/src/rcfile.c 2009-06-30 20:12:28 UTC (rev 1785)
@@ -877,6 +877,14 @@
static void options_parse_global_end(GQParserData *parser_data,
GMarkupParseContext *context, const gchar *element_name, gpointer data, GError
**error)
{
+#ifndef HAVE_EXIV2
+ /* some options do not work without exiv2 */
+ options->metadata.save_in_image_file = FALSE;
+ options->metadata.save_legacy_format = TRUE;
+ options->metadata.write_orientation = FALSE;
+ DEBUG_1("compiled without Exiv2 - disabling XMP write support");
+#endif
+
/* on startup there are no layout windows and this just loads the
editors */
layout_editors_reload_all();
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn