Hello community, here is the log from the commit of package libgexiv2 for openSUSE:Factory checked in at 2020-06-08 23:46:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libgexiv2 (Old) and /work/SRC/openSUSE:Factory/.libgexiv2.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libgexiv2" Mon Jun 8 23:46:55 2020 rev:38 rq:811407 version:0.12.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libgexiv2/libgexiv2.changes 2020-01-28 10:48:34.256567235 +0100 +++ /work/SRC/openSUSE:Factory/.libgexiv2.new.3606/libgexiv2.changes 2020-06-08 23:47:30.642008315 +0200 @@ -1,0 +2,20 @@ +Sat May 23 18:20:50 UTC 2020 - Bjørn Lie <[email protected]> + +- Update to version 0.12.1: + + Support macOS dylib versioning + + Improve compatibility with current exiv2 development versions + + Fix compiling on windows + + Fix issue with problematic symbol visibility of exiv2 + + Fix issues with tests overwriting environment variables + + Fix exception escaping on division by zero + + Fix overflow in altitude fraction conversion + + Fix crash with experimental GIO support + + Documentation fixes + + Add gexiv2_metadata_update_gps_info which will not remove all + other GPS information + + Bugs fixed: glgo#GNOME/gexiv2!41, glgo#GNOME/gexiv2!42, + glgo#GNOME/gexiv2!45, glgo#GNOME/gexiv2!52, + glgo#GNOME/gexiv2!53, glgo#GNOME/gexiv2!54, + glgo#GNOME/gexiv2!55. + +------------------------------------------------------------------- Old: ---- gexiv2-0.12.0.tar.xz New: ---- gexiv2-0.12.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libgexiv2.spec ++++++ --- /var/tmp/diff_new_pack.pRhOBg/_old 2020-06-08 23:47:31.646011413 +0200 +++ /var/tmp/diff_new_pack.pRhOBg/_new 2020-06-08 23:47:31.646011413 +0200 @@ -1,7 +1,7 @@ # # spec file for package libgexiv2 # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,7 +21,7 @@ %bcond_without python2 %bcond_without python3 Name: libgexiv2 -Version: 0.12.0 +Version: 0.12.1 Release: 0 Summary: A GObject-based Exiv2 wrapper License: GPL-2.0-or-later ++++++ gexiv2-0.12.0.tar.xz -> gexiv2-0.12.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/INSTALLING new/gexiv2-0.12.1/INSTALLING --- old/gexiv2-0.12.0/INSTALLING 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/INSTALLING 2020-05-23 19:42:56.574060700 +0200 @@ -4,20 +4,16 @@ To build and install gexiv2, type the following commands: - $ ./configure - $ make - $ make install - - When building from git, you need to run ./autgen.sh to generate the - configure script. + $ meson build && cd build + $ ninja + $ ninja test * By default, gexiv2 will install under /usr/local. The configure script - can customize the prefix directory. Run ./configure --help for + can customize the prefix directory. Run 'meson setup --help' for instructions and other installation options. - - * You may need to execute "make install" as root (i.e. sudo make install) + + * You may need to execute 'ninja install' as root (i.e. sudo ninja install) if installing to system directories. Copyright 2016 Software Freedom Conservancy Inc. - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/NEWS new/gexiv2-0.12.1/NEWS --- old/gexiv2-0.12.0/NEWS 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/NEWS 2020-05-23 19:42:56.574060700 +0200 @@ -1,3 +1,36 @@ +gexiv2 0.12.1 - 23 May 2020 + + * Support macOS dylib versioning + * Improve compatibility with current exiv2 development versions + * Fix compiling on windows + * Fix issue with problematic symbol visibility of exiv2 + * Fix issues with tests overwriting environment variables + * Fix exception escaping on division by zero + * Fix overflow in altitude fraction conversion + * Fix crash with experimental GIO support + * Documentation fixes + * Add gexiv2_metadata_update_gps_info which will not remove all other GPS + information + +Bugs fixed in this release: + - https://gitlab.gnome.org/GNOME/gexiv2/issues/41 + - https://gitlab.gnome.org/GNOME/gexiv2/issues/42 + - https://gitlab.gnome.org/GNOME/gexiv2/issues/45 + - https://gitlab.gnome.org/GNOME/gexiv2/issues/52 + - https://gitlab.gnome.org/GNOME/gexiv2/issues/53 + - https://gitlab.gnome.org/GNOME/gexiv2/issues/54 + - https://gitlab.gnome.org/GNOME/gexiv2/issues/55 + +All contributors to this release: + - Jens Georg <[email protected]> + - Ting-Wei Lan <[email protected]> + - Csaba Toth <[email protected]> + - Thomas Doczkal <[email protected]> + - Thomas Doczkal <[email protected]> + - Christoph Reiter <[email protected]> + - Chris Mayo <[email protected]> + - Tom Schoonjans <[email protected]> + gexiv2 0.12.0 - 11 Mar 2019 * Include a test for https://gitlab.gnome.org/GNOME/shotwell/issues/94 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/build-aux/org.gnome.GExiv2-oldstable.json new/gexiv2-0.12.1/build-aux/org.gnome.GExiv2-oldstable.json --- old/gexiv2-0.12.0/build-aux/org.gnome.GExiv2-oldstable.json 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/build-aux/org.gnome.GExiv2-oldstable.json 2020-05-23 19:42:56.574060700 +0200 @@ -1,7 +1,7 @@ { "app-id" : "org.gnome.GExiv2", "runtime" : "org.gnome.Platform", - "runtime-version" : "3.30", + "runtime-version" : "3.34", "sdk" : "org.gnome.Sdk", "command" : "gexiv2", "tags" : [ @@ -29,7 +29,8 @@ "config-opts" : [ "-DCMAKE_INSTALL_LIBDIR=lib", "-DEXIV2_BUILD_EXIV2_COMMAND=OFF", - "-DEXIV2_BUILD_SAMPLES=OFF" + "-DEXIV2_BUILD_SAMPLES=OFF", + "-DEXIV2_BUILD_UNIT_TESTS=OFF" ], "sources" : [ { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/build-aux/org.gnome.GExiv2-stable.json new/gexiv2-0.12.1/build-aux/org.gnome.GExiv2-stable.json --- old/gexiv2-0.12.0/build-aux/org.gnome.GExiv2-stable.json 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/build-aux/org.gnome.GExiv2-stable.json 2020-05-23 19:42:56.578060600 +0200 @@ -1,7 +1,7 @@ { "app-id" : "org.gnome.GExiv2", "runtime" : "org.gnome.Platform", - "runtime-version" : "3.30", + "runtime-version" : "3.34", "sdk" : "org.gnome.Sdk", "command" : "gexiv2", "tags" : [ @@ -29,7 +29,8 @@ "config-opts" : [ "-DCMAKE_INSTALL_LIBDIR=lib", "-DEXIV2_BUILD_EXIV2_COMMAND=OFF", - "-DEXIV2_BUILD_SAMPLES=OFF" + "-DEXIV2_BUILD_SAMPLES=OFF", + "-DEXIV2_BUILD_UNIT_TESTS=OFF" ], "sources" : [ { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/build-aux/org.gnome.GExiv2.json new/gexiv2-0.12.1/build-aux/org.gnome.GExiv2.json --- old/gexiv2-0.12.0/build-aux/org.gnome.GExiv2.json 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/build-aux/org.gnome.GExiv2.json 2020-05-23 19:42:56.578060600 +0200 @@ -1,7 +1,7 @@ { "app-id" : "org.gnome.GExiv2", "runtime" : "org.gnome.Platform", - "runtime-version" : "3.30", + "runtime-version" : "3.34", "sdk" : "org.gnome.Sdk", "command" : "gexiv2", "tags" : [ @@ -29,7 +29,8 @@ "config-opts" : [ "-DCMAKE_INSTALL_LIBDIR=lib", "-DEXIV2_BUILD_EXIV2_COMMAND=OFF", - "-DEXIV2_BUILD_SAMPLES=OFF" + "-DEXIV2_BUILD_SAMPLES=OFF", + "-DEXIV2_BUILD_UNIT_TESTS=OFF" ], "sources" : [ { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/debian/changelog new/gexiv2-0.12.1/debian/changelog --- old/gexiv2-0.12.0/debian/changelog 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/debian/changelog 2020-05-23 19:42:56.578060600 +0200 @@ -1,3 +1,9 @@ +gexiv2 (0.12.0-0~jensge0~bionic4) bionic; urgency=medium + + * Import new stable release + + -- Jens Georg <[email protected]> Tue, 04 Jun 2019 13:29:03 +0200 + gexiv2 (0.10.6-0~jensge0~xenial1) xenial; urgency=medium * Fix missing include file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/debian/control new/gexiv2-0.12.1/debian/control --- old/gexiv2-0.12.0/debian/control 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/debian/control 2020-05-23 19:42:56.578060600 +0200 @@ -3,13 +3,11 @@ Maintainer: Jens Georg <[email protected]> Build-Depends: debhelper (>= 7), gtk-doc-tools, - autoconf, - autotools-dev, automake, m4, libtool, libglib2.0-dev, - libexiv2-dev, + libexiv2-dev (>= 0.26), libexpat1-dev, gobject-introspection (>= 0.9.12-4~), libgirepository1.0-dev (>= 0.9.12), @@ -17,7 +15,10 @@ python3-gi, python-gi, python:any, - python3:any + python3:any, + dh-python, + valac, + meson Standards-Version: 3.9.8 Section: libs Homepage: https://wiki.gnome.org/Projects/gexiv2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/debian/rules new/gexiv2-0.12.1/debian/rules --- old/gexiv2-0.12.0/debian/rules 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/debian/rules 2020-05-23 19:42:56.578060600 +0200 @@ -5,7 +5,7 @@ # see FEATURE AREAS in dpkg-buildflags(1) -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_BUILD_MAINT_OPTIONS = hardening=+all # see ENVIRONMENT in dpkg-buildflags(1) # package maintainers to append CFLAGS @@ -21,10 +21,10 @@ # dh_make generated override targets # This is example for Cmake (See https://bugs.debian.org/641051 ) override_dh_auto_configure: - dh_auto_configure -- -Denable-gtk-doc=true + dh_auto_configure -- -Dgtk_doc=true override_dh_strip: - dh_strip --dbg-package=libgexiv2-dbg + dh_strip --dbgsym-migration='libgexiv2-dbg (<= 0.12.0-0~~)' override_dh_install: dh_install --list-missing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/gexiv2/gexiv2-metadata-gps.cpp new/gexiv2-0.12.1/gexiv2/gexiv2-metadata-gps.cpp --- old/gexiv2-0.12.0/gexiv2/gexiv2-metadata-gps.cpp 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/gexiv2/gexiv2-metadata-gps.cpp 2020-05-23 19:42:56.578060600 +0200 @@ -89,7 +89,7 @@ return TRUE; } catch (Exiv2::Error &e) { LOG_ERROR(e); - } catch (std::overflow_error &e) { + } catch (std::invalid_argument &e) { LOG_ERROR(e); } @@ -138,7 +138,7 @@ return TRUE; } catch (Exiv2::Error &e) { LOG_ERROR(e); - } catch (std::overflow_error &e) { + } catch (std::invalid_argument &e) { LOG_ERROR(e); } @@ -176,7 +176,7 @@ return TRUE; } catch (Exiv2::Error &e) { LOG_ERROR(e); - } catch (std::overflow_error &e) { + } catch (std::invalid_argument &e) { LOG_ERROR(e); } @@ -216,18 +216,36 @@ try { gexiv2_metadata_delete_gps_info (self); - + + return gexiv2_metadata_update_gps_info (self, longitude, latitude, altitude); + } catch (Exiv2::Error &e) { + LOG_ERROR(e); + } + + return FALSE; +} + +gboolean gexiv2_metadata_update_gps_info (GExiv2Metadata *self, gdouble longitude, gdouble latitude, + gdouble altitude) { + g_return_val_if_fail (GEXIV2_IS_METADATA (self), FALSE); + g_return_val_if_fail(self->priv->image.get() != NULL, FALSE); + + try { Exiv2::ExifData& exif_data = self->priv->image->exifData(); - + gchar buffer [100]; gint deg, min, sec; gdouble remainder, whole; const gint denom = 1000000; - /* set GPS Info Version */ - exif_data ["Exif.GPSInfo.GPSVersionID"] = "2 0 0 0"; - + Exiv2::ExifKey key ("Exif.GPSInfo.GPSVersionID"); + Exiv2::ExifData::iterator it = exif_data.findKey (key); + if (it == exif_data.end()) { + /* set GPS Info Version */ + exif_data ["Exif.GPSInfo.GPSVersionID"] = "2 0 0 0"; + } + /* set GPS Info format */ exif_data ["Exif.GPSInfo.GPSMapDatum"] = "WGS-84"; @@ -236,11 +254,10 @@ exif_data ["Exif.GPSInfo.GPSAltitudeRef"] = "0"; else exif_data ["Exif.GPSInfo.GPSAltitudeRef"] = "1"; - - deg = (gint) floor (fabs (altitude) * denom); - - snprintf (buffer, 100, "%d/%d", deg, denom); - exif_data ["Exif.GPSInfo.GPSAltitude"] = buffer; + + auto frac = Exiv2::floatToRationalCast(static_cast<float>(fabs(altitude))); + + exif_data ["Exif.GPSInfo.GPSAltitude"] = frac; /* set latitude */ if (latitude < 0) @@ -282,6 +299,7 @@ return FALSE; } + void gexiv2_metadata_delete_gps_info (GExiv2Metadata *self) { g_return_if_fail(GEXIV2_IS_METADATA (self)); g_return_if_fail(self->priv->image.get() != NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/gexiv2/gexiv2-metadata-xmp.cpp new/gexiv2-0.12.1/gexiv2/gexiv2-metadata-xmp.cpp --- old/gexiv2-0.12.0/gexiv2/gexiv2-metadata-xmp.cpp 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/gexiv2/gexiv2-metadata-xmp.cpp 2020-05-23 19:42:56.578060600 +0200 @@ -284,11 +284,11 @@ it++; if (it != xmp_data.end()) { - int size = it->count (); + auto size = it->count (); gchar **array = g_new (gchar*, size + 1); array[size] = NULL; - for (int i = 0; i < it->count (); i++) + for (decltype(size) i = 0; i < size; i++) array[i] = g_strdup (it->toString (i).c_str ()); return array; @@ -405,7 +405,7 @@ try { Exiv2::XmpProperties::ns(prefix); - } catch (Exiv2::Error& error) { + } catch (Exiv2::AnyError& error) { // No namespace, OK to register Exiv2::XmpProperties::registerNs(name, prefix); return TRUE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/gexiv2/gexiv2-metadata.cpp new/gexiv2-0.12.1/gexiv2/gexiv2-metadata.cpp --- old/gexiv2-0.12.0/gexiv2/gexiv2-metadata.cpp 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/gexiv2/gexiv2-metadata.cpp 2020-05-23 19:42:56.582060800 +0200 @@ -41,6 +41,13 @@ , _error{nullptr} , _eof{false} {} +#if EXIV2_TEST_VERSION(0,27,99) + using size_type = size_t; +#else + using size_type = long; +#endif + + size_type _size; ~GioIo() { g_clear_object (&_is); g_clear_error (&_error); _seekable = NULL;} #if defined(_MSC_VER) @@ -56,6 +63,17 @@ #endif int open() { + if (_seekable == nullptr) + return 0; + + if (_size >= 0) + return 0; + + auto position = tell(); + seek (0, Exiv2::BasicIo::end); + _size = tell(); + seek (position, Exiv2::BasicIo::beg); + return 0; } @@ -64,15 +82,18 @@ } // Writing is not supported - long write(const Exiv2::byte *data, long wcount) { return 0; } - long write(BasicIo &src) { return 0; } + size_type write(const Exiv2::byte *data, size_type wcount) { return 0; } + size_type write(BasicIo &src) { return 0; } int putb(Exiv2::byte data) { return EOF; } - - Exiv2::DataBuf read(long rcount) { +#if EXIV2_TEST_VERSION(0,27,99) + Exiv2::DataBuf read(size_t rcount) noexcept { +#else + Exiv2::DataBuf read(long rcount) override { +#endif Exiv2::DataBuf b{rcount}; - long bytes_read = this->read(b.pData_, rcount); + auto bytes_read = this->read(b.pData_, rcount); if (bytes_read > 0 && bytes_read != rcount) { b.reset({b.pData_, bytes_read}); } @@ -80,7 +101,7 @@ return b; } - long read(Exiv2::byte *buf, long rcount) { + size_type read(Exiv2::byte *buf, size_type rcount) { GError *error = NULL; gssize result = 0; @@ -182,7 +203,7 @@ } size_t size() const { - return -1; + return static_cast<size_t>(_size); } bool isopen() const { @@ -201,6 +222,15 @@ return "GIO Wrapper"; } +#ifdef EXV_UNICODE_PATH + std::wstring wpath() const { + std::string p = path(); + std::wstring w(p.length(), L' '); + std::copy(p.begin(), p.end(), w.begin()); + return w; + } +#endif + #if EXIV2_TEST_VERSION(0,27,99) Exiv2::BasicIo::UniquePtr temporary() const { return Exiv2::BasicIo::UniquePtr(nullptr); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/gexiv2/gexiv2-metadata.h new/gexiv2-0.12.1/gexiv2/gexiv2-metadata.h --- old/gexiv2-0.12.0/gexiv2/gexiv2-metadata.h 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/gexiv2/gexiv2-metadata.h 2020-05-23 19:42:56.582060800 +0200 @@ -1001,13 +1001,29 @@ * @latitude: Latitude value to set or replace current value * @altitude: Altitude value to set or replace current value * - * Convenience function to query all available GPS information at once. + * Convenience function to create a new set of simple GPS data. Warning: Will remove any other + * GPS information that is currently set. See gexiv2_metadata_update_gps_info() for + * just modifying the GPS data. * * Returns: (skip): Boolean success value. */ gboolean gexiv2_metadata_set_gps_info (GExiv2Metadata *self, gdouble longitude, gdouble latitude, gdouble altitude); /** + * gexiv2_metadata_update_gps_info: + * @self: An instance of #GExiv2Metadata + * @longitude: Longitude value to set or replace current value + * @latitude: Latitude value to set or replace current value + * @altitude: Altitude value to set or replace current value + * + * Convenience function to update longitute, latitude and altitude at once. + * + * Returns: (skip): Boolean success value. + * Since: 0.12.1 + */ +gboolean gexiv2_metadata_update_gps_info (GExiv2Metadata *self, gdouble longitude, gdouble latitude, gdouble altitude); + +/** * gexiv2_metadata_delete_gps_info: * @self: An instance of #GExiv2Metadata * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/gexiv2/gexiv2-stream-io.cpp new/gexiv2-0.12.1/gexiv2/gexiv2-stream-io.cpp --- old/gexiv2-0.12.0/gexiv2/gexiv2-stream-io.cpp 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/gexiv2/gexiv2-stream-io.cpp 2020-05-23 19:42:56.582060800 +0200 @@ -63,11 +63,11 @@ return ptr_type{new Exiv2::MemIo ()}; } -long StreamIo::write (const Exiv2::byte* data, long write_count) { +StreamIo::size_type StreamIo::write (const Exiv2::byte* data, StreamIo::size_type write_count) { if ( ! can_write) return 0; - long total_written_bytes = 0; + StreamIo::size_type total_written_bytes = 0; while (write_count > total_written_bytes) { @@ -83,7 +83,7 @@ return total_written_bytes; } -long StreamIo::write (Exiv2::BasicIo& src) { +StreamIo::size_type StreamIo::write (Exiv2::BasicIo& src) { if ( ! can_write) return 0; @@ -163,6 +163,18 @@ return 0; } +#if EXIV2_TEST_VERSION(0,27,99) + +Exiv2::DataBuf StreamIo::read (size_t read_count) noexcept { + Exiv2::DataBuf buffer (read_count); + + long read_bytes = read (buffer.pData_, buffer.size_); + + buffer.size_ = read_bytes; + + return buffer; +} +#else Exiv2::DataBuf StreamIo::read (long read_count) { Exiv2::DataBuf buffer (read_count); @@ -172,9 +184,10 @@ return buffer; } +#endif -long StreamIo::read (Exiv2::byte* buf, long read_count) { - long total_read_bytes = 0; +StreamIo::size_type StreamIo::read (Exiv2::byte* buf, StreamIo::size_type read_count) { + StreamIo::size_type total_read_bytes = 0; while (read_count > total_read_bytes) { /* because of a marshalling problem on managed side, we shift the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/gexiv2/gexiv2-stream-io.h new/gexiv2-0.12.1/gexiv2/gexiv2-stream-io.h --- old/gexiv2-0.12.0/gexiv2/gexiv2-stream-io.h 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/gexiv2/gexiv2-stream-io.h 2020-05-23 19:42:56.582060800 +0200 @@ -24,8 +24,10 @@ public: #if EXIV2_TEST_VERSION(0,27,99) using ptr_type = Exiv2::BasicIo::UniquePtr; + using size_type = size_t; #else using ptr_type = Exiv2::BasicIo::AutoPtr; + using size_type = long; #endif StreamIo (ManagedStreamCallbacks* cb); @@ -33,11 +35,15 @@ virtual ~StreamIo (); virtual int open (); virtual int close (); - virtual long write (const Exiv2::byte* data, long wcount); - virtual long write (Exiv2::BasicIo& src); + virtual size_type write (const Exiv2::byte* data, size_type wcount); + virtual size_type write (Exiv2::BasicIo& src); virtual int putb (Exiv2::byte data); - virtual Exiv2::DataBuf read (long rcount); - virtual long read (Exiv2::byte* buf, long rcount); +#if EXIV2_TEST_VERSION(0,27,99) + Exiv2::DataBuf read (size_t rcount) noexcept override; +#else + Exiv2::DataBuf read (long rcount) override; +#endif + virtual size_type read (Exiv2::byte* buf, size_type rcount); virtual int getb (); virtual void transfer (Exiv2::BasicIo& src); virtual int seek (long offset, Position pos); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/gexiv2/meson.build new/gexiv2-0.12.1/gexiv2/meson.build --- old/gexiv2-0.12.0/gexiv2/meson.build 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/gexiv2/meson.build 2020-05-23 19:42:56.582060800 +0200 @@ -2,6 +2,13 @@ as_version = meson.project_version().split('.') +libversion = '2.0.0' +libversion_arr = libversion.split('.') +darwin_version_major = libversion_arr[0].to_int() +darwin_version_minor = libversion_arr[1].to_int() +darwin_version_micro = libversion_arr[2].to_int() +darwin_versions = [darwin_version_major + darwin_version_minor + 1, '@0@.@1@'.format(darwin_version_major + darwin_version_minor + 1, darwin_version_micro)] + gexiv2_include_dir = join_paths(get_option('includedir'), 'gexiv2') config = configuration_data() @@ -53,7 +60,8 @@ [version_header] + enum_sources, include_directories : include_directories('..'), - version: '2.0.0', + version: libversion, + darwin_versions: darwin_versions, dependencies : [gobject, exiv2, gio], install : true) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/meson.build new/gexiv2-0.12.1/meson.build --- old/gexiv2-0.12.0/meson.build 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/meson.build 2020-05-23 19:42:56.582060800 +0200 @@ -1,7 +1,8 @@ project( 'gexiv2', ['c', 'cpp'], - version : '0.12.0', + version : '0.12.1', + meson_version : '>=0.48', default_options : [ 'cpp_std=c++11' ] @@ -11,8 +12,10 @@ pkg = import('pkgconfig') exiv2 = dependency('exiv2', version : '>= 0.26') -gobject = dependency('gobject-2.0', version : '>= 2.38.0') -gio = dependency('gio-2.0', version : '>= 2.32.0') +gobject = dependency('gobject-2.0', version : '>= 2.46.0') +gio = dependency('gio-2.0', version : '>= 2.46.0') +cc = meson.get_compiler('c') +math = cc.find_library('m', required : false) gir = find_program('g-ir-scanner', required: false) Binary files old/gexiv2-0.12.0/test/data/original.jpg and new/gexiv2-0.12.1/test/data/original.jpg differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/test/gexiv2-regression.c new/gexiv2-0.12.1/test/gexiv2-regression.c --- old/gexiv2-0.12.0/test/gexiv2-regression.c 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/test/gexiv2-regression.c 2020-05-23 19:42:56.586060800 +0200 @@ -13,6 +13,7 @@ #include <gexiv2/gexiv2.h> #include <string.h> +#include <math.h> const char LOREM_IPSUM[] = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." \ @@ -270,6 +271,31 @@ gexiv2_metadata_register_xmp_namespace ("http://www.gnome.org/xmp", "gnome"); } +static void test_ggo_45(void) +{ + GExiv2Metadata *meta = NULL; + gboolean result = FALSE; + gdouble lon = 0.0, lat = 0.0, alt = 0.0; + GError *error = NULL; + + meta = gexiv2_metadata_new(); + g_assert_nonnull(meta); + result = gexiv2_metadata_open_path(meta, SAMPLE_PATH "/no-metadata.jpg", &error); + g_assert_no_error(error); + g_assert_true(result); + + alt = 2200.0; + result = gexiv2_metadata_set_gps_info(meta, lon, lat, alt); + g_assert_true(result); + + result = gexiv2_metadata_get_gps_altitude(meta, &alt); + g_assert_true(result); + g_assert_cmpfloat(fabs(alt - 2200.0), <= , 1e-5); + + g_clear_object(&meta); + +} + int main(int argc, char *argv[static argc + 1]) { g_test_init(&argc, &argv, NULL); @@ -282,6 +308,7 @@ g_test_add_func("/bugs/gnome/gitlab/33", test_ggo_33); g_test_add_func("/bugs/gnome/gitlab/27", test_ggo_27); g_test_add_func("/bugs/gnome/gitlab/xx", test_ggo_xx); + g_test_add_func("/bugs/gnome/gitlab/45", test_ggo_45); return g_test_run(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/test/meson.build new/gexiv2-0.12.1/test/meson.build --- old/gexiv2-0.12.0/test/meson.build 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/test/meson.build 2020-05-23 19:42:56.586060800 +0200 @@ -1,15 +1,15 @@ test_sample_path = join_paths(meson.current_source_dir(), 'data') python_module_path = join_paths(meson.current_source_dir(), 'python') -test_env = ['G_SLICE=always-malloc', - 'GI_TYPELIB_PATH=@0@'.format(typelib_path), - 'PYTHONPATH=@0@'.format(python_module_path), - 'TEST_DATA_DIR=@0@'.format(test_sample_path), - 'LD_LIBRARY_PATH=@0@'.format(typelib_path), - ] +test_env = environment() +test_env.set('G_SLICE', 'always-malloc') +test_env.set('TEST_DATA_DIR', test_sample_path) +test_env.prepend('GI_TYPELIB_PATH', typelib_path) +test_env.prepend('LD_LIBRARY_PATH', typelib_path) +test_env.prepend('PYTHONPATH', python_module_path) regression_test = executable('gexiv2-regression', 'gexiv2-regression.c', - dependencies : [gobject, gio], + dependencies : [gobject, gio, math], include_directories : include_directories('..'), c_args : '-DSAMPLE_PATH="@0@"'.format(test_sample_path), link_with : gexiv2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/test/python/test_metadata.py new/gexiv2-0.12.1/test/python/test_metadata.py --- old/gexiv2-0.12.0/test/python/test_metadata.py 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/test/python/test_metadata.py 2020-05-23 19:42:56.586060800 +0200 @@ -186,12 +186,12 @@ buf = fd.read() metadata = GExiv2.Metadata() metadata.open_buf(buf) - self.assertEqual(len(metadata.get_exif_tags()), 112) + self.assertEqual(len(metadata.get_exif_tags()), 111) def test_open_path(self): metadata = GExiv2.Metadata() metadata.open_path(self.get_input_file()) - self.assertEqual(len(metadata.get_exif_tags()), 112) + self.assertEqual(len(metadata.get_exif_tags()), 111) def test_get_tag_string(self): self.assertEqual( @@ -199,7 +199,7 @@ for tag in self.metadata.get_exif_tags() if len(self.metadata.get_tag_string(tag)) < 100], [('Exif.Image.DateTime', '2012:11:02 09:04:27'), - ('Exif.Image.ExifTag', '302'), + ('Exif.Image.ExifTag', '234'), ('Exif.Image.ImageDescription', ' '), ('Exif.Image.Make', 'NIKON'), ('Exif.Image.Model', 'COOLPIX P310'), @@ -212,7 +212,7 @@ ('Exif.Iop.InteroperabilityIndex', 'R98'), ('Exif.Iop.InteroperabilityVersion', '48 49 48 48'), ('Exif.MakerNote.ByteOrder', 'II'), - ('Exif.MakerNote.Offset', '1114'), + ('Exif.MakerNote.Offset', '748'), ('Exif.Nikon3.0x000a', '7810/1000'), ('Exif.Nikon3.0x0026', '257 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'), ('Exif.Nikon3.0x0027', '0 0 0 0 0 0 0 0 0 0 0 0 0 0'), @@ -239,7 +239,7 @@ ('Exif.Nikon3.ImageAdjustment', 'NORMAL '), ('Exif.Nikon3.ImageStabilization', 'VR-ON '), ('Exif.Nikon3.NoiseReduction', 'OFF '), - ('Exif.Nikon3.Preview', '2496'), + ('Exif.Nikon3.Preview', '2480'), ('Exif.Nikon3.Quality', 'FINE '), ('Exif.Nikon3.RetouchHistory', '0 0 0 0 0 0 0 0 0 0'), ('Exif.Nikon3.Saturation', '0'), @@ -256,7 +256,7 @@ ('Exif.NikonAf.AFPoint', '0'), ('Exif.NikonAf.AFPointsInFocus', '19'), ('Exif.NikonPreview.Compression', '6'), - ('Exif.NikonPreview.JPEGInterchangeFormat', '13328'), + ('Exif.NikonPreview.JPEGInterchangeFormat', '2586'), ('Exif.NikonPreview.JPEGInterchangeFormatLength', '27981'), ('Exif.NikonPreview.ResolutionUnit', '2'), ('Exif.NikonPreview.XResolution', '300/1'), @@ -283,7 +283,7 @@ ('Exif.Photo.FocalLengthIn35mmFilm', '77'), ('Exif.Photo.GainControl', '2'), ('Exif.Photo.ISOSpeedRatings', '400'), - ('Exif.Photo.InteroperabilityTag', '1084'), + ('Exif.Photo.InteroperabilityTag', '31334'), ('Exif.Photo.LightSource', '0'), ('Exif.Photo.MaxApertureValue', '17/10'), ('Exif.Photo.MeteringMode', '5'), @@ -297,7 +297,7 @@ ('Exif.Photo.SubjectDistanceRange', '0'), ('Exif.Photo.WhiteBalance', '0'), ('Exif.Thumbnail.Compression', '6'), - ('Exif.Thumbnail.JPEGInterchangeFormat', '4084'), + ('Exif.Thumbnail.JPEGInterchangeFormat', '31458'), ('Exif.Thumbnail.JPEGInterchangeFormatLength', '4534'), ('Exif.Thumbnail.ResolutionUnit', '2'), ('Exif.Thumbnail.XResolution', '300/1'), @@ -310,7 +310,7 @@ for tag in self.metadata.get_exif_tags() if len(self.metadata.get_tag_interpreted_string(tag)) < 100], [('Exif.Image.DateTime', '2012:11:02 09:04:27'), - ('Exif.Image.ExifTag', '302'), + ('Exif.Image.ExifTag', '234'), ('Exif.Image.ImageDescription', ' '), ('Exif.Image.Make', 'NIKON'), ('Exif.Image.Model', 'COOLPIX P310'), @@ -323,7 +323,7 @@ ('Exif.Iop.InteroperabilityIndex', 'R98'), ('Exif.Iop.InteroperabilityVersion', '1.00'), ('Exif.MakerNote.ByteOrder', 'II'), - ('Exif.MakerNote.Offset', '1114'), + ('Exif.MakerNote.Offset', '748'), ('Exif.Nikon3.0x000a', '7810/1000'), ('Exif.Nikon3.0x0026', '257 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'), ('Exif.Nikon3.0x0027', '0 0 0 0 0 0 0 0 0 0 0 0 0 0'), @@ -350,7 +350,7 @@ ('Exif.Nikon3.ImageAdjustment', 'NORMAL '), ('Exif.Nikon3.ImageStabilization', 'VR-ON '), ('Exif.Nikon3.NoiseReduction', 'OFF '), - ('Exif.Nikon3.Preview', '2496'), + ('Exif.Nikon3.Preview', '2480'), ('Exif.Nikon3.Quality', 'FINE '), ('Exif.Nikon3.RetouchHistory', 'None'), ('Exif.Nikon3.Saturation', '0'), @@ -367,7 +367,7 @@ ('Exif.NikonAf.AFPoint', 'Center'), ('Exif.NikonAf.AFPointsInFocus', 'Center, Top, Mid-right'), ('Exif.NikonPreview.Compression', 'JPEG (old-style)'), - ('Exif.NikonPreview.JPEGInterchangeFormat', '13328'), + ('Exif.NikonPreview.JPEGInterchangeFormat', '2586'), ('Exif.NikonPreview.JPEGInterchangeFormatLength', '27981'), ('Exif.NikonPreview.ResolutionUnit', 'inch'), ('Exif.NikonPreview.XResolution', '300'), @@ -394,7 +394,7 @@ ('Exif.Photo.FocalLengthIn35mmFilm', '77.0 mm'), ('Exif.Photo.GainControl', 'High gain up'), ('Exif.Photo.ISOSpeedRatings', '400'), - ('Exif.Photo.InteroperabilityTag', '1084'), + ('Exif.Photo.InteroperabilityTag', '31334'), ('Exif.Photo.LightSource', 'Unknown'), ('Exif.Photo.MaxApertureValue', 'F1.8'), ('Exif.Photo.MeteringMode', 'Multi-segment'), @@ -408,7 +408,7 @@ ('Exif.Photo.SubjectDistanceRange', 'Unknown'), ('Exif.Photo.WhiteBalance', 'Auto'), ('Exif.Thumbnail.Compression', 'JPEG (old-style)'), - ('Exif.Thumbnail.JPEGInterchangeFormat', '4084'), + ('Exif.Thumbnail.JPEGInterchangeFormat', '31458'), ('Exif.Thumbnail.JPEGInterchangeFormatLength', '4534'), ('Exif.Thumbnail.ResolutionUnit', 'inch'), ('Exif.Thumbnail.XResolution', '300'), @@ -427,7 +427,7 @@ self.assertFalse(self.metadata.has_tag('Exif.Image.DateTime')) def test_clear(self): - self.assertEqual(len(self.metadata.get_exif_tags()), 112) + self.assertEqual(len(self.metadata.get_exif_tags()), 111) self.assertTrue(self.metadata.has_tag('Exif.Image.DateTime')) self.assertIsNone(self.metadata.clear()) self.assertFalse(self.metadata.has_tag('Exif.Image.DateTime')) @@ -622,14 +622,14 @@ def test_set_exif_thumbnail_from_file(self): self.metadata.set_exif_thumbnail_from_file(self.get_input_file()) thumb = self.metadata.get_exif_thumbnail() - self.assertEqual(len(thumb), 56080) + self.assertEqual(len(thumb), 36660) def test_set_exif_thumbnail_from_buffer(self): with open(self.get_input_file(), 'rb' if PY3K else 'r') as fd: buf = fd.read() self.metadata.set_exif_thumbnail_from_buffer(buf) thumb = self.metadata.get_exif_thumbnail() - self.assertEqual(len(thumb), 56080) + self.assertEqual(len(thumb), 36660) def test_erase_exif_thumbnail(self): self.metadata.erase_exif_thumbnail() @@ -728,7 +728,7 @@ [(tag, self.metadata.get_tag_string(tag)) for tag in self.metadata.get_exif_tags() if 'GPS' in tag], - [('Exif.GPSInfo.GPSAltitude', '10000000/1000000'), + [('Exif.GPSInfo.GPSAltitude', '10/1'), ('Exif.GPSInfo.GPSAltitudeRef', '0'), ('Exif.GPSInfo.GPSLatitude', '48/1 25/1 47999999/1000000'), ('Exif.GPSInfo.GPSLatitudeRef', 'N'), @@ -737,6 +737,68 @@ ('Exif.GPSInfo.GPSMapDatum', 'WGS-84'), ('Exif.GPSInfo.GPSVersionID', '2 0 0 0')]) + def test_bogus_gps_info(self): + # Longitude, latitude, altitude + self.metadata.set_gps_info(1.0, 1.0, 1.0) + bogus_data = '1/0 1/1 1/1' + self.metadata.set_tag_string('Exif.GPSInfo.GPSLatitude', bogus_data) + self.assertAlmostEqual(self.metadata.get_gps_latitude(), 0.0) + self.metadata.set_tag_string('Exif.GPSInfo.GPSLongitude', bogus_data) + self.assertAlmostEqual(self.metadata.get_gps_longitude(), 0.0) + + bogus_data = '1/1 1/0 1/1' + self.metadata.set_tag_string('Exif.GPSInfo.GPSLatitude', bogus_data) + self.assertAlmostEqual(self.metadata.get_gps_latitude(), 1.0) + self.metadata.set_tag_string('Exif.GPSInfo.GPSLongitude', bogus_data) + self.assertAlmostEqual(self.metadata.get_gps_longitude(), 1.0) + + bogus_data = '1/1 6/1 1/0' + self.metadata.set_tag_string('Exif.GPSInfo.GPSLatitude', bogus_data) + self.assertAlmostEqual(self.metadata.get_gps_latitude(), 1.1) + self.metadata.set_tag_string('Exif.GPSInfo.GPSLongitude', bogus_data) + self.assertAlmostEqual(self.metadata.get_gps_longitude(), 1.1) + + self.metadata.set_tag_string('Exif.GPSInfo.GPSAltitude', '1/0') + self.assertAlmostEqual(self.metadata.get_gps_altitude(), 0.0) + + def test_overwrite_gps_info(self): + self.metadata.set_tag_string('Exif.GPSInfo.GPSDateStamp', '2019:04:25') + self.metadata.set_tag_string('Exif.GPSInfo.GPSTimeStamp', '10/1 11/1 50/1') + self.metadata.set_tag_string('Exif.GPSInfo.GPSVersionID', '2 2 0 0') + self.metadata.set_gps_info(-123.35, 48.43, 10) + self.assertEqual( + [(tag, self.metadata.get_tag_string(tag)) + for tag in self.metadata.get_exif_tags() + if 'GPS' in tag], + [('Exif.GPSInfo.GPSAltitude', '10/1'), + ('Exif.GPSInfo.GPSAltitudeRef', '0'), + ('Exif.GPSInfo.GPSLatitude', '48/1 25/1 47999999/1000000'), + ('Exif.GPSInfo.GPSLatitudeRef', 'N'), + ('Exif.GPSInfo.GPSLongitude', '123/1 20/1 59999999/1000000'), + ('Exif.GPSInfo.GPSLongitudeRef', 'W'), + ('Exif.GPSInfo.GPSMapDatum', 'WGS-84'), + ('Exif.GPSInfo.GPSVersionID', '2 0 0 0')]) + + def test_update_gps_info(self): + self.metadata.set_tag_string('Exif.GPSInfo.GPSDateStamp', '2019:04:25') + self.metadata.set_tag_string('Exif.GPSInfo.GPSTimeStamp', '10/1 11/1 50/1') + self.metadata.set_tag_string('Exif.GPSInfo.GPSVersionID', '2 2 0 0') + self.metadata.update_gps_info(-123.35, 48.43, 10) + self.assertEqual( + [(tag, self.metadata.get_tag_string(tag)) + for tag in self.metadata.get_exif_tags() + if 'GPS' in tag], + [('Exif.GPSInfo.GPSAltitude', '10/1'), + ('Exif.GPSInfo.GPSAltitudeRef', '0'), + ('Exif.GPSInfo.GPSDateStamp', '2019:04:25'), + ('Exif.GPSInfo.GPSLatitude', '48/1 25/1 47999999/1000000'), + ('Exif.GPSInfo.GPSLatitudeRef', 'N'), + ('Exif.GPSInfo.GPSLongitude', '123/1 20/1 59999999/1000000'), + ('Exif.GPSInfo.GPSLongitudeRef', 'W'), + ('Exif.GPSInfo.GPSMapDatum', 'WGS-84'), + ('Exif.GPSInfo.GPSTimeStamp', '10/1 11/1 50/1'), + ('Exif.GPSInfo.GPSVersionID', '2 2 0 0')]) + def test_get_preview_properties(self): previews = self.metadata.get_preview_properties() self.assertEqual(len(previews), 2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/test/python2-test.in new/gexiv2-0.12.1/test/python2-test.in --- old/gexiv2-0.12.0/test/python2-test.in 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/test/python2-test.in 2020-05-23 19:42:56.586060800 +0200 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh @PYTHON2_PATH@ -m unittest gexiv2 @PYTHON2_PATH@ -m unittest test_metadata diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gexiv2-0.12.0/test/python3-test.in new/gexiv2-0.12.1/test/python3-test.in --- old/gexiv2-0.12.0/test/python3-test.in 2019-03-11 21:46:27.000000000 +0100 +++ new/gexiv2-0.12.1/test/python3-test.in 2020-05-23 19:42:56.586060800 +0200 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh @PYTHON3_PATH@ -m unittest gexiv2 @PYTHON3_PATH@ -m unittest test_metadata
