[gthumb/gthumb-3-8] Fixed run-time errors if exiv2 is not used



commit 8d29c80417434ee544c061e340f9dba02c4186f2
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Dec 18 09:38:29 2019 +0100

    Fixed run-time errors if exiv2 is not used

 extensions/comments/main.c            | 10 +++++++---
 extensions/importer/gth-import-task.c |  4 ++++
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/extensions/comments/main.c b/extensions/comments/main.c
index ed3727a7..4ae85cae 100644
--- a/extensions/comments/main.c
+++ b/extensions/comments/main.c
@@ -23,7 +23,9 @@
 #include <config.h>
 #include <gtk/gtk.h>
 #include <gthumb.h>
+#ifdef HAVE_EXIV2
 #include <extensions/exiv2_tools/exiv2-utils.h>
+#endif
 #include "callbacks.h"
 #include "dlg-comments-preferences.h"
 #include "gth-comment.h"
@@ -98,9 +100,9 @@ comments__read_metadata_ready_cb (GList      *file_list,
                 * Give priority to the .comment metadata which, if present,
                 * is the most up-to-date. */
 
-               gboolean can_read_embedded_attributes;
-
-               can_read_embedded_attributes = gth_main_extension_is_active ("exiv2_tools");
+#ifdef HAVE_EXIV2
+               gboolean can_read_embedded_attributes = gth_main_extension_is_active ("exiv2_tools");
+#endif
 
                for (scan = file_list; scan; scan = scan->next) {
                        GthFileData *file_data = scan->data;
@@ -111,10 +113,12 @@ comments__read_metadata_ready_cb (GList      *file_list,
                         * case update the .comment metadata with the
                         * embedded metadata. */
                        if (g_file_info_get_attribute_boolean (file_data->info, "comment::no-comment-file")) {
+#ifdef HAVE_EXIV2
                                if (can_read_embedded_attributes) {
                                        exiv2_update_general_attributes (file_data->info);
                                        gth_comment_update_from_general_attributes (file_data);
                                }
+#endif
                        }
                        else
                                gth_comment_update_general_attributes ((GthFileData *) scan->data);
diff --git a/extensions/importer/gth-import-task.c b/extensions/importer/gth-import-task.c
index 519e3956..eb0ec642 100644
--- a/extensions/importer/gth-import-task.c
+++ b/extensions/importer/gth-import-task.c
@@ -21,7 +21,9 @@
 
 #include <config.h>
 #include <extensions/catalogs/gth-catalog.h>
+#ifdef HAVE_EXIV2
 #include <extensions/exiv2_tools/exiv2-utils.h>
+#endif
 #include <extensions/image_rotation/rotation-utils.h>
 #include "gth-import-task.h"
 #include "preferences.h"
@@ -579,12 +581,14 @@ file_buffer_ready_cb (void     **buffer,
 
        file_data = self->priv->current->data;
 
+#ifdef HAVE_EXIV2
        if (gth_main_extension_is_active ("exiv2_tools"))
                exiv2_read_metadata_from_buffer (*buffer,
                                                 count,
                                                 file_data->info,
                                                 TRUE,
                                                 NULL);
+#endif
 
        destination_file = get_destination_file (self, file_data);
        if (destination_file == NULL)


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