Hello community,

here is the log from the commit of package libgexiv2 for openSUSE:Factory 
checked in at 2015-03-30 19:31:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libgexiv2 (Old)
 and      /work/SRC/openSUSE:Factory/.libgexiv2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libgexiv2"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libgexiv2/libgexiv2.changes      2015-02-16 
21:21:44.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libgexiv2.new/libgexiv2.changes 2015-03-30 
19:31:20.000000000 +0200
@@ -1,0 +2,9 @@
+Tue Mar 24 13:47:01 UTC 2015 - [email protected]
+
+- Update to version 0.10.3:
+  + Retrieve XMP tag's structure type (bgo#736799).
+  + Generate XMP packet as NUL-terminated string (bgo#736587).
+  + Retrieve tag's raw value as GBytes (bgo#730136).
+  + Fix gexiv2_metadata_get_fnumber() (bgo#745347).
+
+-------------------------------------------------------------------
@@ -4 +13 @@
-- Update to version 0.10.2
+- Update to version 0.10.2:

Old:
----
  gexiv2-0.10.2.tar.xz

New:
----
  gexiv2-0.10.3.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libgexiv2.spec ++++++
--- /var/tmp/diff_new_pack.iaWSBo/_old  2015-03-30 19:31:20.000000000 +0200
+++ /var/tmp/diff_new_pack.iaWSBo/_new  2015-03-30 19:31:20.000000000 +0200
@@ -19,7 +19,7 @@
 %define tarname gexiv2
 
 Name:           libgexiv2
-Version:        0.10.2
+Version:        0.10.3
 Release:        0
 Summary:        A GObject-based Exiv2 wrapper
 License:        GPL-2.0+

++++++ gexiv2-0.10.2.tar.xz -> gexiv2-0.10.3.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/GExiv2.py new/gexiv2-0.10.3/GExiv2.py
--- old/gexiv2-0.10.2/GExiv2.py 2014-08-08 21:12:46.000000000 +0200
+++ new/gexiv2-0.10.3/GExiv2.py 2015-03-24 00:05:49.000000000 +0100
@@ -78,6 +78,9 @@
     
     def get(self, key, default=None):
         return self.get_tag_string(key) if self.has_tag(key) else default
+
+    def get_raw(self, key):
+        return self.get_tag_raw(key).get_data()
     
     def __iter__(self):
         return iter(self.get_tags())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/Makefile.am 
new/gexiv2-0.10.3/Makefile.am
--- old/gexiv2-0.10.2/Makefile.am       2014-09-17 00:07:53.000000000 +0200
+++ new/gexiv2-0.10.3/Makefile.am       2015-03-24 00:05:49.000000000 +0100
@@ -16,7 +16,10 @@
        @[email protected]             \
        gexiv2/gexiv2-version.m4 \
        $(TYPELIB_FILES) \
-       test/gexiv2-dump.vala
+       test/sample-author-badencoding.jpg \
+       test/gexiv2-dump.vala \
+       test/python/gexiv2.py
+
 
 # Installed Files #
 pkgconfig_DATA  = @[email protected]
@@ -105,16 +108,24 @@
        rm -f gexiv2/gexiv2-version.h
        rm -f gexiv2.pc
        rm -f test/gexiv2-dump
+       rm -rf test/python/gi test/python/__pycache__
 
 # Tests and utilities #
 
 if ENABLE_TESTS
 
-tests: test/gexiv2-dump
+tests: test/gexiv2-dump test/python2 test/python3
 
 test/gexiv2-dump: test/gexiv2-dump.vala
        valac -g --enable-checking --vapidir=. --pkg gexiv2 $< -o $@
 
+test/python/gi/overrides/GExiv2.py:
+       [ -d $(dir $@) ] || mkdir -p $(dir $@)
+       ln -sf ../../../../GExiv2.py $@
+
+test/python%: $(TYPELIB_FILES) test/python/gi/overrides/GExiv2.py
+       LD_LIBRARY_PATH=.libs GI_TYPELIB_PATH=. PYTHONPATH=test/python python$* 
-m unittest gexiv2
+
 endif
 
 # Optional Introspection #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/Makefile.in 
new/gexiv2-0.10.3/Makefile.in
--- old/gexiv2-0.10.2/Makefile.in       2014-09-17 00:15:53.000000000 +0200
+++ new/gexiv2-0.10.3/Makefile.in       2015-03-24 00:14:23.000000000 +0100
@@ -425,7 +425,9 @@
        @[email protected]             \
        gexiv2/gexiv2-version.m4 \
        $(TYPELIB_FILES) \
-       test/gexiv2-dump.vala
+       test/sample-author-badencoding.jpg \
+       test/gexiv2-dump.vala \
+       test/python/gexiv2.py
 
 
 # Installed Files #
@@ -1243,14 +1245,22 @@
        rm -f gexiv2/gexiv2-version.h
        rm -f gexiv2.pc
        rm -f test/gexiv2-dump
+       rm -rf test/python/gi test/python/__pycache__
 
 # Tests and utilities #
 
-@ENABLE_TESTS_TRUE@tests: test/gexiv2-dump
+@ENABLE_TESTS_TRUE@tests: test/gexiv2-dump test/python2 test/python3
 
 @ENABLE_TESTS_TRUE@test/gexiv2-dump: test/gexiv2-dump.vala
 @ENABLE_TESTS_TRUE@    valac -g --enable-checking --vapidir=. --pkg gexiv2 $< 
-o $@
 
+@ENABLE_TESTS_TRUE@test/python/gi/overrides/GExiv2.py:
+@ENABLE_TESTS_TRUE@    [ -d $(dir $@) ] || mkdir -p $(dir $@)
+@ENABLE_TESTS_TRUE@    ln -sf ../../../../GExiv2.py $@
+
+@ENABLE_TESTS_TRUE@test/python%: $(TYPELIB_FILES) 
test/python/gi/overrides/GExiv2.py
+@ENABLE_TESTS_TRUE@    LD_LIBRARY_PATH=.libs GI_TYPELIB_PATH=. 
PYTHONPATH=test/python python$* -m unittest gexiv2
+
 %.typelib: %.gir
        g-ir-compiler --includedir=$(BUILD_DIR) -o $@ $<
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/NEWS new/gexiv2-0.10.3/NEWS
--- old/gexiv2-0.10.2/NEWS      2014-09-17 00:14:13.000000000 +0200
+++ new/gexiv2-0.10.3/NEWS      2015-03-24 00:10:48.000000000 +0100
@@ -1,3 +1,12 @@
+gexiv2 0.10.3 - 23 March 2015
+-----------------------------
+
+  * Retrieve XMP tag's structure type (#736799)
+  * Generate XMP packet as NUL-terminated string (#736587)
+  * Retrieve tag's raw value as GBytes (#730136)
+  * Fix gexiv2_metadata_get_fnumber() (#745347)
+
+
 gexiv2 0.10.2 - 16 September 2014
 ---------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/README new/gexiv2-0.10.3/README
--- old/gexiv2-0.10.2/README    2014-02-04 21:59:05.000000000 +0100
+++ new/gexiv2-0.10.3/README    2015-03-24 00:06:08.000000000 +0100
@@ -26,5 +26,5 @@
 
 
 
-    Copyright 2011-2014 Yorba Foundation
+    Copyright 2011-2015 Yorba Foundation
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/THANKS new/gexiv2-0.10.3/THANKS
--- old/gexiv2-0.10.2/THANKS    2014-09-17 00:07:44.000000000 +0200
+++ new/gexiv2-0.10.3/THANKS    2015-03-24 00:05:49.000000000 +0100
@@ -3,6 +3,7 @@
 Robert Ancell <[email protected]>
 Dan Callaghan <[email protected]>
 Luca Falavigna <[email protected]>
+Hartmut Kuhse <[email protected]>
 Petr Morávek <[email protected]>
 Michael Natterer <[email protected]>
 Jehan Pagès <[email protected]>
@@ -11,6 +12,7 @@
 John Ralls <[email protected]>
 Akhil Ravidas <[email protected]>
 Clint Rogers <[email protected]>
+Alexandre Rossi <[email protected]>
 Alexandre Rostovtsev <[email protected]>
 Ankur Sinha <[email protected]>
 Alexander Steffen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/configure new/gexiv2-0.10.3/configure
--- old/gexiv2-0.10.2/configure 2014-09-17 00:15:53.000000000 +0200
+++ new/gexiv2-0.10.3/configure 2015-03-24 00:14:23.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gexiv2 0.10.2.
+# Generated by GNU Autoconf 2.69 for gexiv2 0.10.3.
 #
 # Report bugs to <[email protected]>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='gexiv2'
 PACKAGE_TARNAME='gexiv2'
-PACKAGE_VERSION='0.10.2'
-PACKAGE_STRING='gexiv2 0.10.2'
+PACKAGE_VERSION='0.10.3'
+PACKAGE_STRING='gexiv2 0.10.3'
 PACKAGE_BUGREPORT='[email protected]'
 PACKAGE_URL='https://wiki.gnome.org/Projects/gexiv2'
 
@@ -1362,7 +1362,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures gexiv2 0.10.2 to adapt to many kinds of systems.
+\`configure' configures gexiv2 0.10.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1432,7 +1432,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gexiv2 0.10.2:";;
+     short | recursive ) echo "Configuration of gexiv2 0.10.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1554,7 +1554,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-gexiv2 configure 0.10.2
+gexiv2 configure 0.10.3
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2136,7 +2136,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by gexiv2 $as_me 0.10.2, which was
+It was created by gexiv2 $as_me 0.10.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3004,7 +3004,7 @@
 
 # Define the identity of the package.
  PACKAGE='gexiv2'
- VERSION='0.10.2'
+ VERSION='0.10.3'
 
 
 # Some tools Automake needs.
@@ -16040,8 +16040,8 @@
 
 GEXIV2_MAJOR_VERSION=0
 GEXIV2_MINOR_VERSION=10
-GEXIV2_MICRO_VERSION=2
-GEXIV2_VERSION=0.10.2
+GEXIV2_MICRO_VERSION=3
+GEXIV2_VERSION=0.10.3
 
 
 
@@ -17155,7 +17155,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by gexiv2 $as_me 0.10.2, which was
+This file was extended by gexiv2 $as_me 0.10.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -17213,7 +17213,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-gexiv2 config.status 0.10.2
+gexiv2 config.status 0.10.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/configure.ac 
new/gexiv2-0.10.3/configure.ac
--- old/gexiv2-0.10.2/configure.ac      2014-09-17 00:09:05.000000000 +0200
+++ new/gexiv2-0.10.3/configure.ac      2015-03-24 00:13:08.000000000 +0100
@@ -1,4 +1,4 @@
-AC_INIT([gexiv2], [0.10.2], [[email protected]], [gexiv2], 
[https://wiki.gnome.org/Projects/gexiv2])
+AC_INIT([gexiv2], [0.10.3], [[email protected]], [gexiv2], 
[https://wiki.gnome.org/Projects/gexiv2])
 AC_PREREQ(2.54)
 
 AC_CONFIG_MACRO_DIR([m4])
@@ -20,7 +20,7 @@
 
 m4_define([gexiv2_major_version], [0])
 m4_define([gexiv2_minor_version], [10])
-m4_define([gexiv2_micro_version], [2])
+m4_define([gexiv2_micro_version], [3])
 m4_define([gexiv2_real_version],
           [gexiv2_major_version.gexiv2_minor_version.gexiv2_micro_version])
 m4_define([gexiv2_version], [gexiv2_real_version])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/gexiv2/gexiv2-metadata-exif.cpp 
new/gexiv2-0.10.3/gexiv2/gexiv2-metadata-exif.cpp
--- old/gexiv2-0.10.2/gexiv2/gexiv2-metadata-exif.cpp   2014-09-17 
00:07:34.000000000 +0200
+++ new/gexiv2-0.10.3/gexiv2/gexiv2-metadata-exif.cpp   2015-03-24 
00:05:49.000000000 +0100
@@ -293,4 +293,31 @@
     return NULL;
 }
 
+GBytes* gexiv2_metadata_get_exif_tag_raw (GExiv2Metadata *self, const gchar* 
tag) {
+    g_return_val_if_fail(GEXIV2_IS_METADATA (self), NULL);
+    g_return_val_if_fail(tag != NULL, NULL);
+    g_return_val_if_fail(self->priv->image.get() != NULL, NULL);
+
+    Exiv2::ExifData &exif_data = self->priv->image->exifData();
+
+    try {
+        Exiv2::ExifData::iterator it = exif_data.findKey(Exiv2::ExifKey(tag));
+        while (it != exif_data.end() && it->count() == 0)
+            it++;
+
+        if (it != exif_data.end()) {
+            long size = it->size();
+            if( size > 0 ) {
+                gpointer data = g_malloc(size);
+                it->copy((Exiv2::byte*)data, Exiv2::invalidByteOrder);
+                return g_bytes_new_take(data, size);
+            }
+        }
+    } catch (Exiv2::Error& e) {
+        LOG_ERROR(e);
+    }
+
+    return NULL;
+}
+
 G_END_DECLS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/gexiv2/gexiv2-metadata-iptc.cpp 
new/gexiv2-0.10.3/gexiv2/gexiv2-metadata-iptc.cpp
--- old/gexiv2-0.10.2/gexiv2/gexiv2-metadata-iptc.cpp   2014-05-13 
01:25:21.000000000 +0200
+++ new/gexiv2-0.10.3/gexiv2/gexiv2-metadata-iptc.cpp   2015-03-24 
00:05:49.000000000 +0100
@@ -277,4 +277,31 @@
     return NULL;
 }
 
+GBytes* gexiv2_metadata_get_iptc_tag_raw (GExiv2Metadata *self, const gchar* 
tag) {
+    g_return_val_if_fail(GEXIV2_IS_METADATA (self), NULL);
+    g_return_val_if_fail(tag != NULL, NULL);
+    g_return_val_if_fail(self->priv->image.get() != NULL, NULL);
+
+    Exiv2::IptcData& iptc_data = self->priv->image->iptcData();
+
+    try {
+        Exiv2::IptcData::iterator it = iptc_data.findKey(Exiv2::IptcKey(tag));
+        while (it != iptc_data.end() && it->count() == 0)
+            it++;
+
+        if (it != iptc_data.end()) {
+            long size = it->size();
+            if( size > 0 ) {
+                gpointer data = g_malloc(size);
+                it->copy((Exiv2::byte*)data, Exiv2::invalidByteOrder);
+                return g_bytes_new_take(data, size);
+            }
+        }
+    } catch (Exiv2::Error& e) {
+        LOG_ERROR(e);
+    }
+
+    return NULL;
+}
+
 G_END_DECLS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/gexiv2/gexiv2-metadata-private.h 
new/gexiv2-0.10.3/gexiv2/gexiv2-metadata-private.h
--- old/gexiv2-0.10.2/gexiv2/gexiv2-metadata-private.h  2014-01-17 
21:14:49.000000000 +0100
+++ new/gexiv2-0.10.3/gexiv2/gexiv2-metadata-private.h  2015-03-24 
00:05:49.000000000 +0100
@@ -50,6 +50,8 @@
 const gchar*   gexiv2_metadata_get_exif_tag_description (const gchar* tag);
 const gchar*   gexiv2_metadata_get_exif_tag_type (const gchar* tag);
 
+GBytes*                        gexiv2_metadata_get_exif_tag_raw        
(GExiv2Metadata *self, const gchar* tag);
+
 /* private XMP functions */
 
 gboolean               gexiv2_metadata_clear_xmp_tag           (GExiv2Metadata 
*self, const gchar* tag);
@@ -66,6 +68,8 @@
 const gchar*   gexiv2_metadata_get_xmp_tag_description (const gchar* tag);
 const gchar*   gexiv2_metadata_get_xmp_tag_type        (const gchar* tag);
 
+GBytes*                        gexiv2_metadata_get_xmp_tag_raw         
(GExiv2Metadata *self, const gchar* tag);
+
 /* private IPTC functions */
 
 gboolean               gexiv2_metadata_clear_iptc_tag          (GExiv2Metadata 
*self, const gchar* tag);
@@ -80,6 +84,7 @@
 const gchar*   gexiv2_metadata_get_iptc_tag_description        (const gchar* 
tag);
 const gchar*   gexiv2_metadata_get_iptc_tag_type       (const gchar* tag);
 
+GBytes*                        gexiv2_metadata_get_iptc_tag_raw        
(GExiv2Metadata *self, const gchar* tag);
 
 G_END_DECLS
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/gexiv2/gexiv2-metadata-xmp.cpp 
new/gexiv2-0.10.3/gexiv2/gexiv2-metadata-xmp.cpp
--- old/gexiv2-0.10.2/gexiv2/gexiv2-metadata-xmp.cpp    2014-09-16 
22:31:19.000000000 +0200
+++ new/gexiv2-0.10.3/gexiv2/gexiv2-metadata-xmp.cpp    2015-03-24 
00:05:49.000000000 +0100
@@ -30,6 +30,22 @@
     self->priv->image->xmpData().clear();
 }
 
+gchar *gexiv2_metadata_generate_xmp_packet(GExiv2Metadata *self, 
+    GExiv2XmpFormatFlags xmp_format_flags, guint32 padding) {
+    g_return_val_if_fail(GEXIV2_IS_METADATA (self), NULL);
+    g_return_val_if_fail(self->priv->image.get() != NULL, NULL);
+    
+    Exiv2::XmpData &xmp_data = self->priv->image->xmpData();
+    try {
+        if (Exiv2::XmpParser::encode(self->priv->image->xmpPacket(), xmp_data, 
xmp_format_flags, padding) == 0)
+          return g_strdup(self->priv->image->xmpPacket().c_str());
+    } catch (Exiv2::Error& e) {
+        LOG_ERROR(e);
+    }
+    
+    return NULL;
+}
+
 gchar *gexiv2_metadata_get_xmp_packet(GExiv2Metadata *self) {
     g_return_val_if_fail(GEXIV2_IS_METADATA (self), NULL);
     g_return_val_if_fail(self->priv->image.get() != NULL, NULL);
@@ -156,6 +172,47 @@
     return NULL;
 }
 
+gboolean gexiv2_metadata_set_xmp_tag_struct (GExiv2Metadata *self, const 
gchar* tag, GExiv2StructureType type) {
+    g_return_val_if_fail(GEXIV2_IS_METADATA (self), FALSE);
+    g_return_val_if_fail(tag != NULL, FALSE);
+    g_return_val_if_fail(self->priv->image.get() != NULL, FALSE);
+
+    Exiv2::XmpTextValue tv("");
+    Exiv2::XmpData& xmp_data = self->priv->image->xmpData();
+
+    switch (type) {
+      case GEXIV2_STRUCTURE_XA_NONE:
+        tv.read("");  // Clear the value
+        tv.setXmpArrayType(Exiv2::XmpValue::xaNone);
+        break;
+      case GEXIV2_STRUCTURE_XA_ALT:
+        tv.read("");
+        tv.setXmpArrayType(Exiv2::XmpValue::xaAlt);
+        break;
+      case GEXIV2_STRUCTURE_XA_BAG:
+        tv.read("");
+        tv.setXmpArrayType(Exiv2::XmpValue::xaBag);
+        break;
+      case GEXIV2_STRUCTURE_XA_SEQ:
+        tv.read("");
+        tv.setXmpArrayType(Exiv2::XmpValue::xaSeq);
+        break;
+      default:
+        g_warning("Invalid structure type.");
+        return FALSE;
+        break;
+    }
+
+    try {
+        xmp_data.add(Exiv2::XmpKey(tag), &tv);
+        return TRUE;
+    } catch (Exiv2::Error& e) {
+        LOG_ERROR(e);
+    }
+    
+    return FALSE;
+}
+
 gboolean gexiv2_metadata_set_xmp_tag_string (GExiv2Metadata *self, const 
gchar* tag, 
     const gchar* value) {
     g_return_val_if_fail(GEXIV2_IS_METADATA (self), FALSE);
@@ -312,6 +369,33 @@
     return NULL;
 }
 
+GBytes* gexiv2_metadata_get_xmp_tag_raw (GExiv2Metadata *self, const gchar* 
tag) {
+    g_return_val_if_fail(GEXIV2_IS_METADATA (self), NULL);
+    g_return_val_if_fail(tag != NULL, NULL);
+    g_return_val_if_fail(self->priv->image.get() != NULL, NULL);
+
+    Exiv2::XmpData& xmp_data = self->priv->image->xmpData();
+
+    try {
+        Exiv2::XmpData::iterator it = xmp_data.findKey(Exiv2::XmpKey(tag));
+        while (it != xmp_data.end() && it->count() == 0)
+            it++;
+
+        if (it != xmp_data.end()) {
+            long size = it->size();
+            if( size > 0 ) {
+                gpointer data = g_malloc(size);
+                it->copy((Exiv2::byte*)data, Exiv2::invalidByteOrder);
+                return g_bytes_new_take(data, size);
+            }
+        }
+    } catch (Exiv2::Error& e) {
+        LOG_ERROR(e);
+    }
+
+    return NULL;
+}
+
 gboolean gexiv2_metadata_register_xmp_namespace (const gchar* name, const 
gchar* prefix) {
     g_return_val_if_fail(name != NULL, FALSE);
     g_return_val_if_fail(prefix != NULL, FALSE);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/gexiv2/gexiv2-metadata.cpp 
new/gexiv2-0.10.3/gexiv2/gexiv2-metadata.cpp
--- old/gexiv2-0.10.2/gexiv2/gexiv2-metadata.cpp        2014-01-17 
21:14:04.000000000 +0100
+++ new/gexiv2-0.10.3/gexiv2/gexiv2-metadata.cpp        2015-03-24 
00:06:27.000000000 +0100
@@ -741,7 +741,7 @@
 }
 
 gdouble gexiv2_metadata_get_fnumber (GExiv2Metadata *self) {
-    return gexiv2_metadata_get_exif_tag_rational_as_double(self, 
"Exif.Photo.Fnumber", -1.0);
+    return gexiv2_metadata_get_exif_tag_rational_as_double(self, 
"Exif.Photo.FNumber", -1.0);
 }
 
 gdouble gexiv2_metadata_get_focal_length (GExiv2Metadata *self) {
@@ -868,4 +868,21 @@
     return NULL;
 }
 
+GBytes* gexiv2_metadata_get_tag_raw(GExiv2Metadata *self, const gchar* tag) {
+    g_return_val_if_fail(GEXIV2_IS_METADATA (self), NULL);
+    g_return_val_if_fail(tag != NULL, NULL);
+    g_return_val_if_fail(self->priv->image.get() != NULL, NULL);
+
+    if (gexiv2_metadata_is_xmp_tag(tag))
+        return gexiv2_metadata_get_xmp_tag_raw(self, tag);
+
+    if (gexiv2_metadata_is_exif_tag(tag))
+        return gexiv2_metadata_get_exif_tag_raw(self, tag);
+
+    if (gexiv2_metadata_is_iptc_tag(tag))
+        return gexiv2_metadata_get_iptc_tag_raw(self, tag);
+
+    return NULL;
+}
+
 G_END_DECLS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/gexiv2/gexiv2-metadata.h 
new/gexiv2-0.10.3/gexiv2/gexiv2-metadata.h
--- old/gexiv2-0.10.2/gexiv2/gexiv2-metadata.h  2014-09-16 22:29:07.000000000 
+0200
+++ new/gexiv2-0.10.3/gexiv2/gexiv2-metadata.h  2015-03-24 00:05:49.000000000 
+0100
@@ -64,6 +64,29 @@
        GEXIV2_ORIENTATION_MAX                  = 8
 } GExiv2Orientation;
 
+typedef enum {
+  GEXIV2_STRUCTURE_XA_NONE = 0,
+  GEXIV2_STRUCTURE_XA_ALT  = 20,
+  GEXIV2_STRUCTURE_XA_BAG  = 21,
+  GEXIV2_STRUCTURE_XA_SEQ  = 22,
+  GEXIV2_STRUCTURE_XA_LANG = 23
+} GExiv2StructureType;
+
+/**
+ * GExiv2XmpFormatFlags:
+ * Options to control the format of the serialized XMP packet
+ * Taken from: exiv2/src/xmp.hpp
+ *
+ */
+typedef enum {
+  GEXIV2_OMIT_PACKET_WRAPPER   = 0x0010UL,  //!< Omit the XML packet wrapper.
+  GEXIV2_READ_ONLY_PACKET      = 0x0020UL,  //!< Default is a writeable packet.
+  GEXIV2_USE_COMPACT_FORMAT    = 0x0040UL,  //!< Use a compact form of RDF.
+  GEXIV2_INCLUDE_THUMBNAIL_PAD = 0x0100UL,  //!< Include a padding allowance 
for a thumbnail image.
+  GEXIV2_EXACT_PACKET_LENGTH   = 0x0200UL,  //!< The padding parameter is the 
overall packet length.
+  GEXIV2_WRITE_ALIAS_COMMENTS  = 0x0400UL,  //!< Show aliases as XML comments.
+  GEXIV2_OMIT_ALL_FORMATTING   = 0x0800UL   //!< Omit all formatting 
whitespace.
+} GExiv2XmpFormatFlags;
 
 typedef struct _GExiv2Metadata                 GExiv2Metadata;
 typedef struct _GExiv2MetadataClass            GExiv2MetadataClass;
@@ -338,6 +361,17 @@
 gboolean               gexiv2_metadata_set_tag_string          (GExiv2Metadata 
*self, const gchar* tag, const gchar* value);
 
 /**
+ * gexiv2_metadata_set_tag_struct:
+ * @tag: Exiv2 tag name
+ * @type: The GExiv2StructureType specifying the type of structure
+ *
+ * The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
+ *
+ * Returns: TRUE on success
+ */
+gboolean gexiv2_metadata_set_xmp_tag_struct (GExiv2Metadata *self, const 
gchar* tag, GExiv2StructureType type);
+
+/**
  * gexiv2_metadata_get_tag_interpreted_string:
  * @tag: Exiv2 tag name
  *
@@ -395,6 +429,16 @@
 gboolean               gexiv2_metadata_set_tag_multiple        (GExiv2Metadata 
*self, const gchar* tag, const gchar** values);
 
 /**
+ * gexiv2_metadata_get_tag_raw:
+ * @tag: Exiv2 tag name
+ *
+ * The Exiv2 Tag Reference can be found at http://exiv2.org/metadata.html
+ *
+ * Returns: (transfer full) (allow-none): The tag's raw value as a byte array
+ */
+GBytes*                        gexiv2_metadata_get_tag_raw                     
(GExiv2Metadata *self, const gchar* tag);
+
+/**
  * EXIF functions
  */
 
@@ -493,9 +537,16 @@
 void                   gexiv2_metadata_clear_xmp                       
(GExiv2Metadata *self);
 
 /**
+ * gexiv2_metadata_generate_xmp_packet:
+ *
+ * Returns: (transfer full) (allow-none): Encode the XMP packet and return as 
a NUL-terminated string.
+ */
+gchar*         gexiv2_metadata_generate_xmp_packet     (GExiv2Metadata *self, 
GExiv2XmpFormatFlags xmp_format_flags, guint32 padding);
+
+/**
  * gexiv2_metadata_get_xmp_packet:
  *
- * Returns: (transfer full) (allow-none): The XMP tag's description
+ * Returns: (transfer full) (allow-none): The currently-encoded XMP packet 
(see gexiv2_metadata_generate_xmp_packet).
  */
 gchar*                 gexiv2_metadata_get_xmp_packet          (GExiv2Metadata 
*self);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/gexiv2/gexiv2-version.h 
new/gexiv2-0.10.3/gexiv2/gexiv2-version.h
--- old/gexiv2-0.10.2/gexiv2/gexiv2-version.h   2014-09-17 00:15:56.000000000 
+0200
+++ new/gexiv2-0.10.3/gexiv2/gexiv2-version.h   2015-03-24 00:14:43.000000000 
+0100
@@ -13,7 +13,7 @@
 
 #define GEXIV2_MAJOR_VERSION 0
 #define GEXIV2_MINOR_VERSION 10
-#define GEXIV2_MICRO_VERSION 2
+#define GEXIV2_MICRO_VERSION 3
 
 /**
  * GEXIV2_CHECK_VERSION:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/gexiv2.vapi 
new/gexiv2-0.10.3/gexiv2.vapi
--- old/gexiv2-0.10.2/gexiv2.vapi       2014-03-17 22:13:05.000000000 +0100
+++ new/gexiv2-0.10.3/gexiv2.vapi       2015-03-24 00:05:49.000000000 +0100
@@ -30,6 +30,7 @@
                public void delete_gps_info ();
                public void erase_exif_thumbnail ();
                public bool from_app1_segment ([CCode (array_length = false)] 
uchar[] data, long n_data) throws GLib.Error;
+               public string? generate_xmp_packet (GExiv2.XmpFormatFlags 
xmp_format_flags, uint32 padding);
                public string? get_comment ();
                public bool get_exif_tag_rational (string tag, out int nom, out 
int den);
                [CCode (array_length = false, array_null_terminated = true)]
@@ -61,6 +62,7 @@
                public long get_tag_long (string tag);
                [CCode (array_length = false, array_null_terminated = true)]
                public string[]? get_tag_multiple (string tag);
+               public GLib.Bytes? get_tag_raw (string tag);
                public string? get_tag_string (string tag);
                public static unowned string get_tag_type (string tag);
                public string? get_xmp_packet ();
@@ -88,6 +90,7 @@
                public bool set_tag_long (string tag, long value);
                public bool set_tag_multiple (string tag, [CCode (array_length 
= false, array_null_terminated = true)] string[] values);
                public bool set_tag_string (string tag, string value);
+               public bool set_xmp_tag_struct (string tag, 
GExiv2.StructureType type);
                public static void unregister_all_xmp_namespaces ();
                public static bool unregister_xmp_namespace (string name);
        }
@@ -132,12 +135,30 @@
                ROT_270,
                MAX
        }
+       [CCode (cheader_filename = "gexiv2/gexiv2.h", cprefix = 
"GEXIV2_STRUCTURE_XA_", has_type_id = false)]
+       public enum StructureType {
+               NONE,
+               ALT,
+               BAG,
+               SEQ,
+               LANG
+       }
        [CCode (cheader_filename = "gexiv2/gexiv2.h", cprefix = "", has_type_id 
= false)]
        public enum WrapperSeekOrigin {
                Begin,
                Current,
                End
        }
+       [CCode (cheader_filename = "gexiv2/gexiv2.h", cprefix = "GEXIV2_", 
has_type_id = false)]
+       public enum XmpFormatFlags {
+               OMIT_PACKET_WRAPPER,
+               READ_ONLY_PACKET,
+               USE_COMPACT_FORMAT,
+               INCLUDE_THUMBNAIL_PAD,
+               EXACT_PACKET_LENGTH,
+               WRITE_ALIAS_COMMENTS,
+               OMIT_ALL_FORMATTING
+       }
        [CCode (cheader_filename = "gexiv2/gexiv2.h", has_target = false)]
        public delegate void LogHandler (GExiv2.LogLevel level, string msg);
        [CCode (cheader_filename = "gexiv2/gexiv2.h", has_target = false)]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gexiv2-0.10.2/test/python/gexiv2.py 
new/gexiv2-0.10.3/test/python/gexiv2.py
--- old/gexiv2-0.10.2/test/python/gexiv2.py     1970-01-01 01:00:00.000000000 
+0100
+++ new/gexiv2-0.10.3/test/python/gexiv2.py     2015-03-24 00:05:49.000000000 
+0100
@@ -0,0 +1,53 @@
+# -*- Mode: Python; py-indent-offset: 4 -*-
+# vim: tabstop=4 shiftwidth=4 expandtab
+#
+# Copyright (C) 2014 Alexandre Rossi <[email protected]>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
+# USA
+
+
+import unittest
+import os
+
+
+# Workaround pkutil.extend_path in dist-packages/gi/overrides/__init__.py
+# not helping us here for obscure reasons when using python2 (the following
+# is useless in python3).
+import gi.overrides
+gi.overrides.__path__.append(os.path.join(os.path.dirname(__file__),
+                                          'gi', 'overrides'))
+
+
+from gi.repository import GExiv2
+
+
+SAMPLES_DIR = os.path.join(os.path.dirname(__file__), '..')
+
+
+class TestGexiv2(unittest.TestCase):
+
+    def get_sample_path(self, sample):
+        return os.path.join(SAMPLES_DIR, sample)
+
+    def test_author_badencoding(self):
+        sample = 'sample-author-badencoding.jpg'
+        md = GExiv2.Metadata(self.get_sample_path(sample))
+
+        self.assertEqual(md.get_raw('Exif.Image.Artist'), 
b'\xc0\xeb\xe5\xea\xf1\xe0\xed\xe4\xf0 \xca\xee\xf8\xe5\xeb\xe5\xe2\x00')
+
+
+if __name__ == '__main__':
+    unittest.main()
Files old/gexiv2-0.10.2/test/sample-author-badencoding.jpg and 
new/gexiv2-0.10.3/test/sample-author-badencoding.jpg differ


Reply via email to