Commit 8d29c804 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

Fixed run-time errors if exiv2 is not used

parent dbaa6e98
......@@ -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);
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment