[gimp/metadata-browser] Workaround for EXIF data import which crashes the plug-in.
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] Workaround for EXIF data import which crashes the plug-in.
- Date: Fri, 2 Dec 2011 02:24:27 +0000 (UTC)
commit 0bff516e1768e751cdaeb408f032d77544c572d9
Author: Roman Joost <roman bromeco de>
Date: Fri Dec 2 11:05:56 2011 +1000
Workaround for EXIF data import which crashes the plug-in.
This workaround allows to run the plug-in when opening a JPEG. The
import/merge of EXIF data is currently not working. All data is set as a
scalar property. This is invalid data by the XMP metadata
standard. A proper fix will need more code for the import in
exif-decode.c
plug-ins/metadata/tests/Makefile.am | 1 +
plug-ins/metadata/xmp-encode.c | 15 ++++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/metadata/tests/Makefile.am b/plug-ins/metadata/tests/Makefile.am
index 27f1b48..15bd343 100644
--- a/plug-ins/metadata/tests/Makefile.am
+++ b/plug-ins/metadata/tests/Makefile.am
@@ -18,6 +18,7 @@ LDADD = \
$(libgimpconfig) \
$(libgimpcolor) \
$(libgimpbase) \
+ $(GTK_LIBS) \
$(GLIB_LIBS) \
../base64.o \
../xmp-parse.o \
diff --git a/plug-ins/metadata/xmp-encode.c b/plug-ins/metadata/xmp-encode.c
index e20e04d..df642e0 100644
--- a/plug-ins/metadata/xmp-encode.c
+++ b/plug-ins/metadata/xmp-encode.c
@@ -240,8 +240,9 @@ gen_property (GString *buffer,
case XMP_TYPE_DEVICE_SETTINGS:
case XMP_TYPE_CONTACT_INFO:
case XMP_TYPE_GENERIC_STRUCTURE:
- if (value_array[0] && value_array[1]
- && !! strcmp (value_array[1], schema->uri))
+ if ((value_array != NULL)
+ && (value_array[0] && value_array[1]
+ && !! strcmp (value_array[1], schema->uri)))
{
g_string_append_printf (buffer,
" <%s:%s rdf:parseType='Resource'\n"
@@ -257,13 +258,21 @@ gen_property (GString *buffer,
schema->prefix, property->name);
ns_prefix = schema->prefix;
}
- if (value_array[0] && value_array[1])
+ if (value_array != NULL && value_array[0] && value_array[1])
+ {
for (i = 2; value_array[i] != NULL; i += 2)
{
gen_element (buffer, 3,
ns_prefix, value_array[i], value_array[i + 1],
NULL);
}
+ }
+ else
+ {
+ gen_element (buffer, 3,
+ ns_prefix, property->name, value,
+ NULL);
+ }
g_string_append_printf (buffer, " </%s:%s>\n",
schema->prefix, property->name);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]