gexiv2 issueshttps://gitlab.gnome.org/GNOME/gexiv2/-/issues2020-05-23T12:57:25Zhttps://gitlab.gnome.org/GNOME/gexiv2/-/issues/55terminate called after throwing an instance of 'std::invalid_argument' what...2020-05-23T12:57:25ZRobert Jäschketerminate called after throwing an instance of 'std::invalid_argument' what(): Invalid fractionAfter updating from Debian Jessie (Shotwell 0.20.1) to Buster (Shotwell 0.30.1) Shotwell dies with the following error message when clicking on a thumbnail:
```
terminate called after throwing an instance of 'std::invalid_argument'
wh...After updating from Debian Jessie (Shotwell 0.20.1) to Buster (Shotwell 0.30.1) Shotwell dies with the following error message when clicking on a thumbnail:
```
terminate called after throwing an instance of 'std::invalid_argument'
what(): Invalid fraction
```
Apparently, this is caused by either (broken) metadata or photos, as Shotwell works fine when moving `~/.local/share/shotwell` out of the way and starting a new import.
The latest stable version (0.30.9, self-compiled from tarball) shows the same problem. Downgrading to 0.20.1 solves it and thus is a reasonable workaround.
Attached you find a [shotwell.gdb](/uploads/1275a88164d16dc286fa7679f127e931/shotwell.gdb) and [shotwell.log](/uploads/2e442377501ddef3c3e5441e3abf2e06/shotwell.log).
## Mandatory: Shotwell version the issue was seen with
> 0.30.1 and 0.30.9
Kernel version:
> Linux edge 4.19.0-8-amd64 shotwell#1 SMP Debian 4.19.98-1+deb10u1 (2020-04-27) x86_64 GNU/Linux
## The expected behaviour
> Clicking on a thumbnail should show the large photo.
## What was actually happening
> Shotwell dies leaving the following error message in the console:
```
terminate called after throwing an instance of 'std::invalid_argument'
what(): Invalid fraction
```
## Steps to reproduce the issue
> Very likely this issue happens only with certain image databases. Maybe some data is corrupt?
Attachements:
- [shotwell.gdb](/uploads/96f0812737c40d6e314fcea700b3dc93/shotwell.gdb)
- [shotwell.log](/uploads/59e601f35877ba1802aa5bdd2d47234b/shotwell.log)https://gitlab.gnome.org/GNOME/gexiv2/-/issues/51Infinite loop when reading file2020-04-25T20:16:48ZAlexander ThallerInfinite loop when reading fileRunning `exiv2 0.27.2`.
When reading a file from disk the tool never terminates.
Running strace I can see that it tries to run the following infinitely
```
lseek(3, 0, SEEK_CUR) = 1769375131
```
I suspect that the fi...Running `exiv2 0.27.2`.
When reading a file from disk the tool never terminates.
Running strace I can see that it tries to run the following infinitely
```
lseek(3, 0, SEEK_CUR) = 1769375131
```
I suspect that the file its trying to read is corrupt but it would be a nicer behavior to terminate instead of looping.
I attached the file in question and the complete strace.
[strace output](/uploads/60f31380491547a6546785317d1576ff/out)
[20170223_1657008.avi](/uploads/03d2f6f129dac5adb243131020e5f9ad/20170223_1657008.avi)
Mpv has no problems playing the file.
Thank you for the help.https://gitlab.gnome.org/GNOME/gexiv2/-/issues/49Fail to compile with Exiv2 0.27.22019-12-22T13:56:25ZTing-Wei LanFail to compile with Exiv2 0.27.2```
[6/23] Compiling C++ object 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o'.
FAILED: gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o
clang++ -B/home/lantw44/.local/bin -Igexiv2/1a6c516@@gexiv2@sha -Igexiv2 -I../../source/gexiv2/...```
[6/23] Compiling C++ object 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o'.
FAILED: gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o
clang++ -B/home/lantw44/.local/bin -Igexiv2/1a6c516@@gexiv2@sha -Igexiv2 -I../../source/gexiv2/gexiv2 -Igexiv2/.. -I../../source/gexiv2/gexiv2/.. -I/home/lantw44/gnome/devinstall/include/glib-2.0 -I/home/lantw44/gnome/devinstall/lib/glib-2.0/include -I/usr/local/lib/libffi-3.2.1/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -O2 -g -march=corei7 -B/home/lantw44/.local/bin -g3 -Og -gz -fdebug-macro -fPIC -pthread -MD -MQ 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o' -MF 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o.d' -o 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o' -c ../../source/gexiv2/gexiv2/gexiv2-metadata.cpp
../../source/gexiv2/gexiv2/gexiv2-metadata.cpp:90:26: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'long' in initializer list [-Wc++11-narrowing]
Exiv2::DataBuf b{rcount};
^~~~~~
../../source/gexiv2/gexiv2/gexiv2-metadata.cpp:90:26: note: insert an explicit cast to silence this issue
Exiv2::DataBuf b{rcount};
^~~~~~
static_cast<long>( )
1 error generated.
```
In Exiv2 0.27.2, the constructor is declared as `explicit DataBuf(long size);`, and passing `size_t` (which is unsigned) is not allowed.https://gitlab.gnome.org/GNOME/gexiv2/-/issues/29critical errors while previewing from MTP phone2019-10-12T01:17:21Zjimiscritical errors while previewing from MTP phoneUsing shotwell-0.28.3-1.fc27.x86_64
After I connect the phone, previewing starts automatically. In the console I get plenty of critical errors, that are mostly of 2 kinds:
```
L 9070 2018-05-26 03:01:18 [CRT] Upper boundary of data for...Using shotwell-0.28.3-1.fc27.x86_64
After I connect the phone, previewing starts automatically. In the console I get plenty of critical errors, that are mostly of 2 kinds:
```
L 9070 2018-05-26 03:01:18 [CRT] Upper boundary of data for directory Photo, entry 0xa420 is out of bounds: Offset = 0x0000028e, size = 25, exceeds buffer size by 1 Bytes; truncating the entry
```
and
```
L 9070 2018-05-26 03:01:39 [CRT] Upper boundary of data for directory GPSInfo, entry 0x0004 is out of bounds: Offset = 0x00000302, size = 24, exceeds buffer size by 2 Bytes; truncating the entry
```
I can't see anything going wrong though. What do these errors mean and why are they critical?
Thank you in advance!
EDIT: Same issue with the following message printed by shotwell, moved from issue shotwell#2:
```
L 9070 2018-05-26 03:04:02 [WRN] Directory Thumbnail, entry 0x0201: Data area exceeds data buffer, ignoring it.
```
https://gitlab.gnome.org/GNOME/gexiv2/-/issues/47Please clarify the license for the project2019-10-06T10:23:24ZMichał GórnyPlease clarify the license for the projectWhat is the intended actual license for the project?
`debian/copyright` claims it's 'GPL-2 or later'. However, I can't find any real grounds for the 'or later' there.
All C sources reference `COPYING` which in turn is verbatim copy of ...What is the intended actual license for the project?
`debian/copyright` claims it's 'GPL-2 or later'. However, I can't find any real grounds for the 'or later' there.
All C sources reference `COPYING` which in turn is verbatim copy of GPL-2. It contains the 'or later' clause only as an example of copyright notice, so that can't really be taken as clear allowance to use later version.
`GExiv2.py` indicates 'LGPL-2.1 or later'. I'm not convinced it's allowed to combine it (even indirectly via introspection) to a library that's using more restrictive GPL license. However, IANAL, so I'm not going to argue about that.
`test_metadata.py` indicates 'GPL-3 or later'. Again, it is unclear whether it is valid to combine it with 'GPL-2' sources.https://gitlab.gnome.org/GNOME/gexiv2/-/issues/44Subclassing GExiv2.Metadata in Python eats exceptions from get_tag_multiple()...2019-08-21T19:14:17ZJames LuSubclassing GExiv2.Metadata in Python eats exceptions from get_tag_multiple(), causing CPython to crashIn the [Variety](https://github.com/varietywalls/variety) program, we use GExiv2 to keep track of metadata when we download pictures from remote sources. In https://github.com/varietywalls/variety/issues/152, there have been multiple rep...In the [Variety](https://github.com/varietywalls/variety) program, we use GExiv2 to keep track of metadata when we download pictures from remote sources. In https://github.com/varietywalls/variety/issues/152, there have been multiple reports of `free(): invalid pointer` crashes, and Python's faulthandler seems to point to a `get_tag_multiple()` call as the reason.
In particular, we use a subclass of GExiv2.Metadata that exposes key-value indexing of metadata fields: https://github.com/varietywalls/variety/blob/master/variety/Util.py#L152-L188. At first glance, I don't see anything strange in that bit of Python code (and it seems [subclassing is generally supported by PyGObject](https://pygobject.readthedocs.io/en/latest/guide/api/gobject.html)).
I've written some test cases using images provided by the reporters: [02263_flash_1920x1080.jpg.zip](https://github.com/varietywalls/variety/files/3394162/02263_flash_1920x1080.jpg.zip), [200717040711-1867.jpg](https://nidus.paiyakdev.com/screens/200717040711-1867.jpg). The result: when reading the image using GExiv2.Metadata, an exception is raised. Reading it with the VarietyMetadata subclass however, crashes the Python interpreter!
On my system, I am using exiv2 0.25-4 and gexiv2 0.26-1, both from the Debian testing repositories.
----
I used this test case for VarietyMetadata, called `vrty-crash.py`:
```python
#!/usr/bin/env python3
import sys
from variety.Util import VarietyMetadata
try:
path = sys.argv[1]
except IndexError:
print('Error: need 1 argument: path to file', file=sys.stderr)
sys.exit(1)
x = VarietyMetadata(path)
print(x)
print(x.get_tag_multiple('Iptc.Application2.Keywords'))
```
and I get the following results:
```
$ python3 vrty-crash.py 02263_flash_1920x1080.jpg
<Util.VarietyMetadata object at 0x7f14cb76c120 (variety+Util+VarietyMetadata at 0xe1da20)>
free(): invalid pointer
Aborted
```
----
Using GExiv2.Metadata, I get a proper exception instead:
```python
#!/usr/bin/env python3
import sys
from gi.repository import GExiv2
try:
path = sys.argv[1]
except IndexError:
print('Error: need 1 argument: path to file', file=sys.stderr)
sys.exit(1)
x = GExiv2.Metadata(path)
print(x)
print(x.get_tag_multiple('Iptc.Application2.Keywords'))
```
```
$ python3 vrty-crash2.py 02263_flash_1920x1080.jpg
vrty-crash2.py:4: PyGIWarning: GExiv2 was imported without specifying a version first. Use gi.require_version('GExiv2', '0.10') before import to ensure that the right version gets loaded.
from gi.repository import GExiv2
<GExiv2.Metadata object at 0x7fa548915ea0 (GExiv2Metadata at 0x1a3ba80)>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9a in position 1: invalid start byte
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "vrty-crash2.py", line 14, in <module>
print(x.get_tag_multiple('Iptc.Application2.Keywords'))
SystemError: <class 'gobject.Warning'> returned a result with an error set
```https://gitlab.gnome.org/GNOME/gexiv2/-/issues/46Fails to find installed dependicy2019-08-14T20:12:30ZGhost UserFails to find installed dependicypipeline@pestilence:~/Applications/gexiv2-0.12.0/build$ pwd
/home/pipeline/Applications/gexiv2-0.12.0/build
pipeline@pestilence:~/Applications/gexiv2-0.12.0/build$ meson --prefix=/usr ..
The Meson build system
Version: 0.47.2
...pipeline@pestilence:~/Applications/gexiv2-0.12.0/build$ pwd
/home/pipeline/Applications/gexiv2-0.12.0/build
pipeline@pestilence:~/Applications/gexiv2-0.12.0/build$ meson --prefix=/usr ..
The Meson build system
Version: 0.47.2
Source dir: /home/pipeline/Applications/gexiv2-0.12.0
Build dir: /home/pipeline/Applications/gexiv2-0.12.0/build
Build type: native build
Project name: gexiv2
Project version: 0.12.0
Native C compiler: cc (gcc 4.8.5 "cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)")
Native C++ compiler: c++ (gcc 4.8.5 "c++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /bin/pkg-config (0.27.1)
meson.build:13:0: ERROR: Native dependency 'exiv2' not found
A full log can be found at /home/pipeline/Applications/gexiv2-0.12.0/build/meson-logs/meson-log.txt
1 pipeline@pestilence:~/Applications/gexiv2-0.12.0/build$ exiv2 -V
exiv2 0.26 001a00 (64 bit build)
Copyright (C) 2004-2017 Andreas Huggel.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
pipeline@pestilence:~/Applications/gexiv2-0.12.0/build$ which exiv2
/bin/exiv2
[meson-log.txt](/uploads/0ab5cb4b5fd5aeb3f5d7a69c99c62795/meson-log.txt)https://gitlab.gnome.org/GNOME/gexiv2/-/issues/5Convert Exiv2 exceptions to GError2019-07-09T08:32:27ZBugzillaConvert Exiv2 exceptions to GError## Submitted by Valencia Maintainers
**[Link to original bug (#712432)](https://bugzilla.gnome.org/show_bug.cgi?id=712432)**
## Description
---- Reported by valencia-maint@gnome.bugs 2013-08-03 04:23:00 -0700 ----
Original Redmi...## Submitted by Valencia Maintainers
**[Link to original bug (#712432)](https://bugzilla.gnome.org/show_bug.cgi?id=712432)**
## Description
---- Reported by valencia-maint@gnome.bugs 2013-08-03 04:23:00 -0700 ----
Original Redmine bug id: 7297
Original URL: http://redmine.yorba.org/issues/7297
Searchable id: yorba-bug-7297
Original author: Alessandro Tanasi
Original description:
I am using gevix2 0.4.90-0ubuntu1 and when procesing a bunch of images inside
a python script i got errors directly printed to stderr in this format:
** (process:27945): WARNING **: error message
Why they aren't handled via exceptions but silently printed to screen?
Related issues:
related to gexiv2 - Feature #7318: GDateTime accessor (Open)
---- Additional Comments From valencia-maint@gnome.bugs 2013-09-19 11:24:00 -0700 ----
### History
---
Comment 1
Updated by Jim Nelson 3 months ago
* **Status** changed from _Open_ to _Need Information_
Can you tell us what messages you're seeing printed to the console?
---
Comment 2
Updated by Alessandro Tanasi 3 months ago
Example:
** (process:4772): CRITICAL **: Offset of directory Image, entry 0x9c9d is out of bounds: Offset = 0x00000000; truncating the entry
** (process:4772): CRITICAL **: Offset of directory Image, entry 0xea1c is out of bounds: Offset = 0x00000000; truncating the entry
** (process:4772): CRITICAL **: Offset of directory Photo, entry 0xea1c is out of bounds: Offset = 0x00000000; truncating the entry
** (process:4772): WARNING **: Invalid key `Iptc.Application2.Caption'
---
Comment 3
Updated by Jim Nelson 3 months ago
* **Subject** changed from _Errors printedd to stderr_ to _Convert Exiv2 exceptions to GError_
* **Category** set to _interface_
* **Status** changed from _Need Information_ to _Open_
The first three errors are emitted by Exiv2, the library gexiv2 wraps. They
are never presented to gexiv2 to be thrown as exceptions. The last error
message is, I believe, an exception from Exiv2 being logged.
If you want to control whether or not those first three messages are displayed
(and others like them), gexiv2 has an interface for that:
gexiv2_log_set_handler() allows for you to install a callback and determine
what, if anything, to print.
I've updated the ticket title to reflect what's being asked here. This would
be an interface change, which I don't believe we'll be doing in the next
release.
---
Comment 4
Updated by Alessandro Tanasi about 1 month ago
I am migrating an application from pyexiv and this never happened, errors was
handled.
I see the interface you are talking but it's for C, and I am using Gexiv via
python code, or is there a way to silent ti from python code?
---
Comment 5
Updated by Jim Nelson about 1 month ago
Because gexiv2 is written in C, the errors should be generated there. I
suppose the Python bindings could convert result codes into GErrors and throw
them (I don't know much Python), but ultimately we'd like for this to happen
in the library itself.
--- Bug imported by chaz@yorba.org 2013-11-16 14:44 UTC ---
This bug was previously known as _bug_ 7297 at http://redmine.yorba.org/show_bug.cgi?id=7297
Unknown version " in product gexiv2.
Setting version to "!unspecified".
Unknown milestone "unknown in product gexiv2.
Setting to default milestone for this product, "---".
Setting qa contact to the default for this product.
This bug either had no qa contact or an invalid one.
Resolution set on an open status.
Dropping resolutionhttps://gitlab.gnome.org/GNOME/gexiv2/-/issues/23Temporary binary link error on Debian 8 stable2019-07-09T07:20:00ZBugzillaTemporary binary link error on Debian 8 stable## Submitted by med..@..il.com
**[Link to original bug (#779204)](https://bugzilla.gnome.org/show_bug.cgi?id=779204)**
## Description
Hello again, everyone.
Sorry to bring another issue to your attention so soon after you fixed 779...## Submitted by med..@..il.com
**[Link to original bug (#779204)](https://bugzilla.gnome.org/show_bug.cgi?id=779204)**
## Description
Hello again, everyone.
Sorry to bring another issue to your attention so soon after you fixed 779089, but this new error was shown after I pulled the latest changes today. As before, I'm building against exiv2-0.25 and am using a custom prefix. Here's the output of make:
```
Making all in .
make[1]: Entering directory '/home/ricky/bin/gexiv2'
GISCAN GExiv2-0.10.gir
./.libs/libgexiv2.so: undefined reference to `Exiv2::ImageFactory::open(std::string const&)'
collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['/bin/bash', './libtool', '--mode=link', '--tag=CC', '--silent', 'cc', '-o', '/home/ricky/bin/gexiv2/tmp-introspect6rDHoC/GExiv2-0.10', '-export-dynamic', '/home/ricky/bin/gexiv2/tmp-introspect6rDHoC/GExiv2-0.10.o', '-L.', 'libgexiv2.la', '-L/home/ricky/bin/gimp-clean/install/lib', '-lgio-2.0', '-lgobject-2.0', '-Wl,--export-dynamic', '-lgmodule-2.0', '-pthread', '-lglib-2.0']' returned non-zero exit status 1
/usr/share/gobject-introspection-1.0/Makefile.introspection:153: recipe for target 'GExiv2-0.10.gir' failed
make[1]: *** [GExiv2-0.10.gir] Error 1
make[1]: Leaving directory '/home/ricky/bin/gexiv2'
Makefile:969: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
And in case you need the extra info, here's the output of make V=1:
Making all in .
make[1]: Entering directory '/home/ricky/bin/gexiv2'
/usr/bin/g-ir-scanner --symbol-prefix=gexiv2 --add-include-path= --pkg-export=gexiv2 --warn-all --warn-error --namespace=GExiv2 --nsversion=0.10 --libtool="/bin/bash ./libtool" --include=GObject-2.0 --library=libgexiv2.la --cflags-begin -I. -Igexiv2 --cflags-end gexiv2/gexiv2.h gexiv2/gexiv2-metadata.h gexiv2/gexiv2-preview-properties.h gexiv2/gexiv2-preview-image.h gexiv2/gexiv2-log.h gexiv2/gexiv2-startup.h gexiv2/gexiv2-version.h libgexiv2.la --output GExiv2-0.10.gir
g-ir-scanner: compile: cc -Wno-deprecated-declarations -pthread -I/home/ricky/bin/gimp-clean/install/include/glib-2.0 -I/home/ricky/bin/gimp-clean/install/lib/glib-2.0/include -I/home/ricky/bin/gimp-clean/install/include/glib-2.0 -I/home/ricky/bin/gimp-clean/install/lib/glib-2.0/include -c -o /home/ricky/bin/gexiv2/tmp-introspect4NWA1w/GExiv2-0.10.o /home/ricky/bin/gexiv2/tmp-introspect4NWA1w/GExiv2-0.10.c
g-ir-scanner: link: /bin/bash ./libtool --mode=link --tag=CC cc -o /home/ricky/bin/gexiv2/tmp-introspect4NWA1w/GExiv2-0.10 -export-dynamic /home/ricky/bin/gexiv2/tmp-introspect4NWA1w/GExiv2-0.10.o -L. libgexiv2.la -L/home/ricky/bin/gimp-clean/install/lib -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0
libtool: link: cc -o /home/ricky/bin/gexiv2/tmp-introspect4NWA1w/.libs/GExiv2-0.10 /home/ricky/bin/gexiv2/tmp-introspect4NWA1w/GExiv2-0.10.o -Wl,--export-dynamic -pthread -Wl,--export-dynamic -L. ./.libs/libgexiv2.so -L/home/ricky/bin/gimp-clean/install/lib /home/ricky/bin/gimp-clean/install/lib/libgio-2.0.so /home/ricky/bin/gimp-clean/install/lib/libgobject-2.0.so /home/ricky/bin/gimp-clean/install/lib/libgmodule-2.0.so /home/ricky/bin/gimp-clean/install/lib/libglib-2.0.so -pthread -Wl,-rpath -Wl,/home/ricky/bin/gimp-clean/install/lib
./.libs/libgexiv2.so: undefined reference to `Exiv2::ImageFactory::open(std::string const&)'
collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['/bin/bash', './libtool', '--mode=link', '--tag=CC', 'cc', '-o', '/home/ricky/bin/gexiv2/tmp-introspect4NWA1w/GExiv2-0.10', '-export-dynamic', '/home/ricky/bin/gexiv2/tmp-introspect4NWA1w/GExiv2-0.10.o', '-L.', 'libgexiv2.la', '-L/home/ricky/bin/gimp-clean/install/lib', '-lgio-2.0', '-lgobject-2.0', '-Wl,--export-dynamic', '-lgmodule-2.0', '-pthread', '-lglib-2.0']' returned non-zero exit status 1
/usr/share/gobject-introspection-1.0/Makefile.introspection:153: recipe for target 'GExiv2-0.10.gir' failed
make[1]: *** [GExiv2-0.10.gir] Error 1
make[1]: Leaving directory '/home/ricky/bin/gexiv2'
Makefile:969: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
```
Thank you very much for fixing 779089 so quickly, and for any help you can give on this.
Version: 0.10.xhttps://gitlab.gnome.org/GNOME/gexiv2/-/issues/42Crash on FreeBSD because of the use of Exiv2::Error2019-07-09T07:15:03ZTing-Wei LanCrash on FreeBSD because of the use of Exiv2::ErrorIn header file exiv2/error.hpp, `Exiv2::Error` is declared as `Exiv2::BasicError<char>`, but `Exiv2::BasicError` isn't marked as `EXIV2API`, suggesting it isn't an exported type and should not be used by other libraries or applications. ...In header file exiv2/error.hpp, `Exiv2::Error` is declared as `Exiv2::BasicError<char>`, but `Exiv2::BasicError` isn't marked as `EXIV2API`, suggesting it isn't an exported type and should not be used by other libraries or applications. The use of `Exiv2::Error` in gexiv2 causes GNOME Photos to crash on FreeBSD because `gexiv2_metadata_register_xmp_namespace` relies on the ability to catch the exception thrown by `Exiv2::XmpProperties::ns`. Since typeinfo of `Exiv2::BasicError` isn't exported, `libcxxrt` doesn't know `gexiv2_metadata_register_xmp_namespace` catches the exception and aborts the program.
This problem can be avoided if `Exiv2::Error` is replaced by `Exiv2::AnyError`. `Exiv2::AnyError` is marked as `EXIV2API`, so it should be safe to use.
```diff
diff --git a/gexiv2/gexiv2-metadata-xmp.cpp b/gexiv2/gexiv2-metadata-xmp.cpp
index eac78b7..8c14e40 100644
--- a/gexiv2/gexiv2-metadata-xmp.cpp
+++ b/gexiv2/gexiv2-metadata-xmp.cpp
@@ -405,7 +405,7 @@ gboolean gexiv2_metadata_register_xmp_namespace (const gchar* name, const gchar*
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;
```
Please see https://github.com/Exiv2/exiv2/issues/947 for more details.https://gitlab.gnome.org/GNOME/gexiv2/-/issues/410.12.0 fails to build2019-06-03T08:09:58ZChristoph Reiter0.12.0 fails to buildgit bisect points to b1795fe15853 @jensgeorg
```cpp
FAILED: gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.obj
ccache c++ @gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.obj.rsp
../gexiv2/gexiv2-metadata.cpp: In function 'gboolean gexiv...git bisect points to b1795fe15853 @jensgeorg
```cpp
FAILED: gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.obj
ccache c++ @gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.obj.rsp
../gexiv2/gexiv2-metadata.cpp: In function 'gboolean gexiv2_metadata_from_stream(GExiv2Metadata*, GInputStream*, GError**)':
../gexiv2/gexiv2-metadata.cpp:406:50: error: invalid new-expression of abstract class type '{anonymous}::GioIo'
406 | GioIo::ptr_type gio_ptr{new GioIo (stream)};
| ^
../gexiv2/gexiv2-metadata.cpp:35:7: note: because the following virtual functions are pure within '{anonymous}::GioIo':
35 | class GioIo : public Exiv2::BasicIo {
| ^~~~~
In file included from C:/msys64/mingw32/include/exiv2/exiv2.hpp:34,
from ../gexiv2/gexiv2-metadata-private.h:14,
from ../gexiv2/gexiv2-metadata.cpp:12:
C:/msys64/mingw32/include/exiv2/basicio.hpp:231:30: note: 'virtual std::wstring Exiv2::BasicIo::wpath() const'
231 | virtual std::wstring wpath() const =0;
| ^~~~~
../gexiv2/gexiv2-metadata.cpp:406:51: error: no matching function for call to 'std::auto_ptr<Exiv2::BasicIo>::auto_ptr(<brace-enclosed initializer list>)'
406 | GioIo::ptr_type gio_ptr{new GioIo (stream)};
| ^
In file included from C:/msys64/mingw32/include/c++/9.1.0/memory:84,
from C:/msys64/mingw32/include/exiv2/value.hpp:41,
from C:/msys64/mingw32/include/exiv2/metadatum.hpp:38,
from C:/msys64/mingw32/include/exiv2/datasets.hpp:33,
from C:/msys64/mingw32/include/exiv2/exiv2.hpp:33,
from ../gexiv2/gexiv2-metadata-private.h:14,
from ../gexiv2/gexiv2-metadata.cpp:12:
C:/msys64/mingw32/include/c++/9.1.0/backward/auto_ptr.h:266:7: note: candidate: 'std::auto_ptr< <template-parameter-1-1> >::auto_ptr(std::auto_ptr_ref<_Tp>) [with _Tp = Exiv2::BasicIo]'
266 | auto_ptr(auto_ptr_ref<element_type> __ref) throw()
| ^~~~~~~~
C:/msys64/mingw32/include/c++/9.1.0/backward/auto_ptr.h:266:7: note: conversion of argument 1 would be ill-formed:
C:/msys64/mingw32/include/c++/9.1.0/backward/auto_ptr.h:127:9: note: candidate: 'template<class _Tp1> std::auto_ptr< <template-parameter-1-1> >::auto_ptr(std::auto_ptr<_Up>&)'
127 | auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
| ^~~~~~~~
C:/msys64/mingw32/include/c++/9.1.0/backward/auto_ptr.h:127:9: note: template argument deduction/substitution failed:
C:/msys64/mingw32/include/c++/9.1.0/backward/auto_ptr.h:114:7: note: candidate: 'std::auto_ptr< <template-parameter-1-1> >::auto_ptr(std::auto_ptr< <template-parameter-1-1> >&) [with _Tp = Exiv2::BasicIo]'
114 | auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
| ^~~~~~~~
C:/msys64/mingw32/include/c++/9.1.0/backward/auto_ptr.h:114:7: note: conversion of argument 1 would be ill-formed:
C:/msys64/mingw32/include/c++/9.1.0/backward/auto_ptr.h:105:7: note: candidate: 'std::auto_ptr< <template-parameter-1-1> >::auto_ptr(std::auto_ptr< <template-parameter-1-1> >::element_type*) [with _Tp = Exiv2::BasicIo; std::auto_ptr< <template-parameter-1-1> >::element_type = Exiv2::BasicIo]'
105 | auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
| ^~~~~~~~
C:/msys64/mingw32/include/c++/9.1.0/backward/auto_ptr.h:105:7: note: conversion of argument 1 would be ill-formed:
ninja: build stopped: subcommand failed.
```https://gitlab.gnome.org/GNOME/gexiv2/-/issues/21Makefile.am uses hardcoded path to pkgconfig2019-03-26T21:04:35ZBugzillaMakefile.am uses hardcoded path to pkgconfig## Submitted by Sergey Avseyev
**[Link to original bug (#772881)](https://bugzilla.gnome.org/show_bug.cgi?id=772881)**
## Description
Created attachment 337654
Patch for Makefile.am
configure script defines special set variables to...## Submitted by Sergey Avseyev
**[Link to original bug (#772881)](https://bugzilla.gnome.org/show_bug.cgi?id=772881)**
## Description
Created attachment 337654
Patch for Makefile.am
configure script defines special set variables to be used in Makefile, one of them PKG_CONFIG_LIBDIR, which should be used instead of hardcoded.
**Patch 337654**, "Patch for Makefile.am":
[0001-Allow-to-redefine-pkgconf-directory-with-.-configure.patch](/uploads/d5a6f183493f50620311a7e0e3aa6d8c/0001-Allow-to-redefine-pkgconf-directory-with-.-configure.patch)
Version: 0.10.xhttps://gitlab.gnome.org/GNOME/gexiv2/-/issues/40master not up to date with gexiv2 0.12.02019-03-12T19:57:27ZTom Schoonjansmaster not up to date with gexiv2 0.12.0The gexiv2-0.12.0 tagged commit is not in master yet...
Sorry, just bringing this up because I want to open a MR against master and cannot because it's not up to data :smile:The gexiv2-0.12.0 tagged commit is not in master yet...
Sorry, just bringing this up because I want to open a MR against master and cannot because it's not up to data :smile:https://gitlab.gnome.org/GNOME/gexiv2/-/issues/39VAPI changes with version 0.11.02019-01-28T16:22:16ZFabio ValentiniVAPI changes with version 0.11.0Up to version 0.10.10, elementary/photos compiled fine against gexiv2, but with version 0.11.0 in rawhide, I'm getting build failures. I've originally reported this issue here: https://github.com/elementary/photos/issues/484
This is the...Up to version 0.10.10, elementary/photos compiled fine against gexiv2, but with version 0.11.0 in rawhide, I'm getting build failures. I've originally reported this issue here: https://github.com/elementary/photos/issues/484
This is the error message:
```
../src/photos/PhotoMetadata.vala:177.9-177.39: error: 1 extra arguments for `bool GExiv2.Metadata.open_buf (uint8[])'
exiv2.open_buf (buffer, length);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../src/photos/PhotoMetadata.vala:191.9-191.48: error: 1 extra arguments for `bool GExiv2.Metadata.from_app1_segment (uint8[])'
exiv2.from_app1_segment (buffer, length);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
However, since the ABI wasn't bumped for the `0.11.0` release of gexiv2, I now think this is possibly an issue with the generated VAPI file.https://gitlab.gnome.org/GNOME/gexiv2/-/issues/27No namespace info available ... (issue with exported functions?)2019-01-19T09:07:22ZBugzillaNo namespace info available ... (issue with exported functions?)## Submitted by Antoine Jacoutot
**[Link to original bug (#795628)](https://bugzilla.gnome.org/show_bug.cgi?id=795628)**
## Description
Hi :-)
This commit: 3c801e70a9ea7271a76a58ce15867923143864a2 which added a version script to li...## Submitted by Antoine Jacoutot
**[Link to original bug (#795628)](https://bugzilla.gnome.org/show_bug.cgi?id=795628)**
## Description
Hi :-)
This commit: 3c801e70a9ea7271a76a58ce15867923143864a2 which added a version script to limit exported functions had a weird side effect on OpenBSD (current, amd64).
It looks like gexiv2_metadata_register_xmp_namespace now fails...
$ gnome-photos
terminating with uncaught exception of type Exiv2::BasicError`<char>`: No namespace info available for XMP prefix `gnome'
Abort trap (core dumped)
Version: 0.10.xhttps://gitlab.gnome.org/GNOME/gexiv2/-/issues/38Suggestion/request: change gtk_doc option to gtk-doc2019-01-19T09:07:22ZhanetzerSuggestion/request: change gtk_doc option to gtk-docSo as to match python{2,3}-girdir, and also match gentoo's gtk-doc use flag.So as to match python{2,3}-girdir, and also match gentoo's gtk-doc use flag.https://gitlab.gnome.org/GNOME/gexiv2/-/issues/37GIMP ends faulty EXIF report to stderr2019-01-02T18:40:43ZGhost UserGIMP ends faulty EXIF report to stderrMy Panasonic TZ-70 camera outputs broken EXIF tags in JPG images, probably when it thinks flash would be a good idea. GIMP detects this fault if the EXIF data is displayed with (File|Properties|Advanced) but the error report is only writ...My Panasonic TZ-70 camera outputs broken EXIF tags in JPG images, probably when it thinks flash would be a good idea. GIMP detects this fault if the EXIF data is displayed with (File|Properties|Advanced) but the error report is only written to stderr. Nothing is displayed on the desktop to alert the user. I only found the report because I was running GIMP from the command line.
GIMP itself works fine, apart from:
- not making the error visible to a desktop user
- preserving the error even if the image is modified and exported as JPG.
The first attachment is an edited image containing this messed-up EXIF data.
The second attached file, exif-flash.txt, shows GIMP's stderr output.
![MJQ_Under_The_Jasmine_Tree](/uploads/91a5bd95019ece49d5cd57b8e8990a1e/MJQ_Under_The_Jasmine_Tree.jpg)
[exif-flash.txt](/uploads/cfd4ec1eeba4dfa8ec0881668970ae48/exif-flash.txt)https://gitlab.gnome.org/GNOME/gexiv2/-/issues/36Another build error building with exiv2 from Debian Buster2019-01-02T14:58:39Zn3rdopolisAnother build error building with exiv2 from Debian BusterHi
After #35 was closed, I still get a new build error
```
ninja: Entering directory `build'
[1/11] Compiling C++ object 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o'.
FAILED: gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o
c++ ...Hi
After #35 was closed, I still get a new build error
```
ninja: Entering directory `build'
[1/11] Compiling C++ object 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o'.
FAILED: gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o
c++ -Igexiv2/1a6c516@@gexiv2@sha -Igexiv2 -I../gexiv2 -Igexiv2/.. -I../gexiv2/.. -I/opt/include/glib-2.0 -I/opt/lib/i386-linux-gnu/glib-2.0/include -I/opt/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=c++11 -Os -Wno-error -fPIC -pthread -MD -MQ 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o' -MF 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o.d' -o 'gexiv2/1a6c516@@gexiv2@sha/gexiv2-metadata.cpp.o' -c ../gexiv2/gexiv2-metadata.cpp
../gexiv2/gexiv2-metadata.cpp: In member function ‘virtual long int {anonymous}::GioIo::read(Exiv2::byte*, long int)’:
../gexiv2/gexiv2-metadata.cpp:87:33: error: no matching function for call to ‘Exiv2::BasicError<char>::BasicError(int)’
throw Exiv2::Error(2);
^
In file included from /opt/include/exiv2/iptc.hpp:34,
from /opt/include/exiv2/bmpimage.hpp:33,
from /opt/include/exiv2/exiv2.hpp:35,
from ../gexiv2/gexiv2-metadata-private.h:14,
from ../gexiv2/gexiv2-metadata.cpp:12:
/opt/include/exiv2/error.hpp:280:9: note: candidate: ‘template<class A, class B, class C> Exiv2::BasicError<charT>::BasicError(Exiv2::ErrorCode, const A&, const B&, const C&)’
BasicError(ErrorCode code, const A& arg1, const B& arg2, const C& arg3);
^~~~~~~~~~
/opt/include/exiv2/error.hpp:280:9: note: template argument deduction/substitution failed:
../gexiv2/gexiv2-metadata.cpp:87:33: note: candidate expects 4 arguments, 1 provided
throw Exiv2::Error(2);
^
In file included from /opt/include/exiv2/iptc.hpp:34,
from /opt/include/exiv2/bmpimage.hpp:33,
from /opt/include/exiv2/exiv2.hpp:35,
from ../gexiv2/gexiv2-metadata-private.h:14,
from ../gexiv2/gexiv2-metadata.cpp:12:
/opt/include/exiv2/error.hpp:276:9: note: candidate: ‘template<class A, class B> Exiv2::BasicError<charT>::BasicError(Exiv2::ErrorCode, const A&, const B&)’
BasicError(ErrorCode code, const A& arg1, const B& arg2);
^~~~~~~~~~
/opt/include/exiv2/error.hpp:276:9: note: template argument deduction/substitution failed:
../gexiv2/gexiv2-metadata.cpp:87:33: note: candidate expects 3 arguments, 1 provided
throw Exiv2::Error(2);
^
In file included from /opt/include/exiv2/iptc.hpp:34,
from /opt/include/exiv2/bmpimage.hpp:33,
from /opt/include/exiv2/exiv2.hpp:35,
from ../gexiv2/gexiv2-metadata-private.h:14,
from ../gexiv2/gexiv2-metadata.cpp:12:
/opt/include/exiv2/error.hpp:272:9: note: candidate: ‘template<class A> Exiv2::BasicError<charT>::BasicError(Exiv2::ErrorCode, const A&)’
BasicError(ErrorCode code, const A& arg1);
^~~~~~~~~~
/opt/include/exiv2/error.hpp:272:9: note: template argument deduction/substitution failed:
../gexiv2/gexiv2-metadata.cpp:87:33: note: candidate expects 2 arguments, 1 provided
throw Exiv2::Error(2);
^
In file included from /opt/include/exiv2/iptc.hpp:34,
from /opt/include/exiv2/bmpimage.hpp:33,
from /opt/include/exiv2/exiv2.hpp:35,
from ../gexiv2/gexiv2-metadata-private.h:14,
from ../gexiv2/gexiv2-metadata.cpp:12:
/opt/include/exiv2/error.hpp:336:5: note: candidate: ‘Exiv2::BasicError<charT>::BasicError(Exiv2::ErrorCode) [with charT = char]’ <near match>
BasicError<charT>::BasicError(ErrorCode code)
^~~~~~~~~~~~~~~~~
/opt/include/exiv2/error.hpp:336:5: note: conversion of argument 1 would be ill-formed:
../gexiv2/gexiv2-metadata.cpp:87:33: error: invalid conversion from ‘int’ to ‘Exiv2::ErrorCode’ [-fpermissive]
throw Exiv2::Error(2);
^
In file included from /opt/include/exiv2/iptc.hpp:34,
from /opt/include/exiv2/bmpimage.hpp:33,
from /opt/include/exiv2/exiv2.hpp:35,
from ../gexiv2/gexiv2-metadata-private.h:14,
from ../gexiv2/gexiv2-metadata.cpp:12:
/opt/include/exiv2/error.hpp:263:11: note: candidate: ‘Exiv2::BasicError<char>::BasicError(const Exiv2::BasicError<char>&)’
class BasicError : public AnyError {
^~~~~~~~~~
/opt/include/exiv2/error.hpp:263:11: note: no known conversion for argument 1 from ‘int’ to ‘const Exiv2::BasicError<char>&’
../gexiv2/gexiv2-metadata.cpp: In function ‘gboolean gexiv2_metadata_from_stream(GExiv2Metadata*, GInputStream*, GError**)’:
../gexiv2/gexiv2-metadata.cpp:391:25: error: ‘AutoPtr’ is not a member of ‘Exiv2::BasicIo’
Exiv2::BasicIo::AutoPtr gio_ptr (new GioIo (stream));
^~~~~~~
../gexiv2/gexiv2-metadata.cpp:392:56: error: ‘gio_ptr’ was not declared in this scope
self->priv->image = Exiv2::ImageFactory::open (gio_ptr);
^~~~~~~
../gexiv2/gexiv2-metadata.cpp:392:56: note: suggested alternative: ‘gintptr’
self->priv->image = Exiv2::ImageFactory::open (gio_ptr);
^~~~~~~
gintptr
ninja: build stopped: subcommand failed.
PackageInstallSource finished in 0 seconds with result 1
```
Thankshttps://gitlab.gnome.org/GNOME/gexiv2/-/issues/35Does not compile against exiv2 master2019-01-01T17:03:32ZJens GeorgDoes not compile against exiv2 masterExiv2 removed Exiv2::Image::AutoPtr. See https://gitlab.gnome.org/GNOME/gexiv2/pipelines/47512
And https://github.com/Exiv2/exiv2/issues/611Exiv2 removed Exiv2::Image::AutoPtr. See https://gitlab.gnome.org/GNOME/gexiv2/pipelines/47512
And https://github.com/Exiv2/exiv2/issues/611https://gitlab.gnome.org/GNOME/gexiv2/-/issues/34Build issue with Exiv2 v0.27 RC22019-01-01T11:46:12ZRobin MillsBuild issue with Exiv2 v0.27 RC2Thanks for your great work on gexiv2.
I'm the maintainer of Exiv2. We released Exiv2 v0.27 RC2 on Saturday and yesterday we received this issue: https://github.com/Exiv2/exiv2/issues/555.
The fix has been added to 'master'. Can I as...Thanks for your great work on gexiv2.
I'm the maintainer of Exiv2. We released Exiv2 v0.27 RC2 on Saturday and yesterday we received this issue: https://github.com/Exiv2/exiv2/issues/555.
The fix has been added to 'master'. Can I ask you to investigate your build and let's be sure this everything is great before we arrive at Exiv2 v0.27 GM on 2018-12-28.