[gexiv2] Add missing error to exif_*_multiple
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gexiv2] Add missing error to exif_*_multiple
- Date: Tue, 17 Nov 2020 21:34:24 +0000 (UTC)
commit 76be56d373b820940647603a07f49dce96dd202b
Author: Jens Georg <mail jensge org>
Date: Tue Nov 17 22:27:55 2020 +0100
Add missing error to exif_*_multiple
gexiv2/gexiv2-metadata-exif.cpp | 11 +++++++----
gexiv2/gexiv2-metadata-private.h | 7 +++++--
gexiv2/gexiv2-metadata.cpp | 4 ++--
3 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/gexiv2/gexiv2-metadata-exif.cpp b/gexiv2/gexiv2-metadata-exif.cpp
index 77e8807..0d2d27f 100644
--- a/gexiv2/gexiv2-metadata-exif.cpp
+++ b/gexiv2/gexiv2-metadata-exif.cpp
@@ -119,7 +119,7 @@ gchar* gexiv2_metadata_get_exif_tag_string (GExiv2Metadata *self, const gchar* t
return NULL;
}
-gchar** gexiv2_metadata_get_exif_tag_multiple(GExiv2Metadata* self, const gchar* tag) {
+gchar** gexiv2_metadata_get_exif_tag_multiple(GExiv2Metadata* self, const gchar* tag, GError** error) {
g_return_val_if_fail(GEXIV2_IS_METADATA(self), nullptr);
g_return_val_if_fail(self->priv != nullptr, nullptr);
g_return_val_if_fail(self->priv->image.get() != nullptr, nullptr);
@@ -142,7 +142,7 @@ gchar** gexiv2_metadata_get_exif_tag_multiple(GExiv2Metadata* self, const gchar*
return array;
}
} catch (Exiv2::Error& e) {
- LOG_ERROR(e);
+ g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what());
}
array = g_new(gchar*, 1);
@@ -151,7 +151,10 @@ gchar** gexiv2_metadata_get_exif_tag_multiple(GExiv2Metadata* self, const gchar*
return array;
}
-gboolean gexiv2_metadata_set_exif_tag_multiple(GExiv2Metadata* self, const gchar* tag, const gchar** values)
{
+gboolean gexiv2_metadata_set_exif_tag_multiple(GExiv2Metadata* self,
+ const gchar* tag,
+ const gchar** values,
+ GError** error) {
g_return_val_if_fail(GEXIV2_IS_METADATA(self), FALSE);
g_return_val_if_fail(tag != nullptr, FALSE);
g_return_val_if_fail(values != nullptr, FALSE);
@@ -179,7 +182,7 @@ gboolean gexiv2_metadata_set_exif_tag_multiple(GExiv2Metadata* self, const gchar
}
return TRUE;
} catch (Exiv2::Error& e) {
- LOG_ERROR(e);
+ g_set_error_literal(error, g_quark_from_string("GExiv2"), e.code(), e.what());
}
return FALSE;
diff --git a/gexiv2/gexiv2-metadata-private.h b/gexiv2/gexiv2-metadata-private.h
index 0d81154..7675945 100644
--- a/gexiv2/gexiv2-metadata-private.h
+++ b/gexiv2/gexiv2-metadata-private.h
@@ -44,8 +44,11 @@ G_GNUC_INTERNAL gboolean gexiv2_metadata_has_exif_tag
(GExiv2Metadata *self, c
G_GNUC_INTERNAL gboolean gexiv2_metadata_clear_exif_tag (GExiv2Metadata *self, const
gchar* tag);
G_GNUC_INTERNAL gchar* gexiv2_metadata_get_exif_tag_string (GExiv2Metadata *self, const
gchar* tag, GError **error);
G_GNUC_INTERNAL gboolean gexiv2_metadata_set_exif_tag_string (GExiv2Metadata *self, const
gchar* tag, const gchar* value, GError **error);
-G_GNUC_INTERNAL gchar** gexiv2_metadata_get_exif_tag_multiple(GExiv2Metadata* self, const gchar*
tag);
-G_GNUC_INTERNAL gboolean gexiv2_metadata_set_exif_tag_multiple(GExiv2Metadata* self, const gchar*
tag, const gchar** values);
+G_GNUC_INTERNAL gchar** gexiv2_metadata_get_exif_tag_multiple(GExiv2Metadata* self, const gchar* tag,
GError** error);
+G_GNUC_INTERNAL gboolean gexiv2_metadata_set_exif_tag_multiple(GExiv2Metadata* self,
+ const gchar* tag,
+ const gchar** values,
+ GError** error);
G_GNUC_INTERNAL gchar* gexiv2_metadata_get_exif_tag_interpreted_string (GExiv2Metadata
*self, const gchar* tag);
G_GNUC_INTERNAL glong gexiv2_metadata_get_exif_tag_long (GExiv2Metadata *self, const
gchar* tag);
G_GNUC_INTERNAL gboolean gexiv2_metadata_set_exif_tag_long (GExiv2Metadata *self, const
gchar* tag, glong value);
diff --git a/gexiv2/gexiv2-metadata.cpp b/gexiv2/gexiv2-metadata.cpp
index 1356924..1b2abec 100644
--- a/gexiv2/gexiv2-metadata.cpp
+++ b/gexiv2/gexiv2-metadata.cpp
@@ -1060,7 +1060,7 @@ gchar** gexiv2_metadata_try_get_tag_multiple(GExiv2Metadata *self, const gchar*
return gexiv2_metadata_get_xmp_tag_multiple(self, tag, error);
if (gexiv2_metadata_is_exif_tag(tag))
- return gexiv2_metadata_get_exif_tag_multiple(self, tag);
+ return gexiv2_metadata_get_exif_tag_multiple(self, tag, error);
if (gexiv2_metadata_is_iptc_tag(tag))
return gexiv2_metadata_get_iptc_tag_multiple(self, tag, error);
@@ -1078,7 +1078,7 @@ gboolean gexiv2_metadata_try_set_tag_multiple(GExiv2Metadata *self, const gchar*
return gexiv2_metadata_set_xmp_tag_multiple(self, tag, values, error);
if (gexiv2_metadata_is_exif_tag(tag))
- return gexiv2_metadata_set_exif_tag_multiple(self, tag, values);
+ return gexiv2_metadata_set_exif_tag_multiple(self, tag, values, error);
if (gexiv2_metadata_is_iptc_tag(tag))
return gexiv2_metadata_set_iptc_tag_multiple(self, tag, values, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]