QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

Build fails with exiv2 0.28

Open ggardet opened this issue 1 year ago • 1 comments

What is the bug or the crash?

Build fails with exiv2 0.28:

[ 2238s] /home/abuild/rpmbuild/BUILD/qgis-3.30.3/src/core/raster/qgsexiftools.cpp: In function 'QVariant decodeXmpData(const QString&, Exiv2::XmpData::const_iterator&)':
[ 2238s] /home/abuild/rpmbuild/BUILD/qgis-3.30.3/src/core/raster/qgsexiftools.cpp:69:40: error: 'const class Exiv2::Xmpdatum' has no member named 'toLong'
[ 2238s]    69 |         val = QVariant::fromValue( it->toLong() );
[ 2238s]       |                                        ^~~~~~
[ 2238s] /home/abuild/rpmbuild/BUILD/qgis-3.30.3/src/core/raster/qgsexiftools.cpp:83:60: error: 'const class Exiv2::Xmpdatum' has no member named 'toLong'
[ 2238s]    83 |         val = QVariant::fromValue( static_cast< int >( it->toLong() ) );
[ 2238s]       |                                                            ^~~~~~
[ 2238s] /home/abuild/rpmbuild/BUILD/qgis-3.30.3/src/core/raster/qgsexiftools.cpp: In function 'QVariant decodeExifData(const QString&, Exiv2::ExifData::const_iterator&)':
[ 2238s] /home/abuild/rpmbuild/BUILD/qgis-3.30.3/src/core/raster/qgsexiftools.cpp:185:40: error: 'const class Exiv2::Exifdatum' has no member named 'toLong'
[ 2238s]   185 |         val = QVariant::fromValue( it->toLong() );
[ 2238s]       |                                        ^~~~~~
[ 2238s] /home/abuild/rpmbuild/BUILD/qgis-3.30.3/src/core/raster/qgsexiftools.cpp:199:60: error: 'const class Exiv2::Exifdatum' has no member named 'toLong'
[ 2238s]   199 |         val = QVariant::fromValue( static_cast< int >( it->toLong() ) );
[ 2238s]       |                                                            ^~~~~~

Steps to reproduce the issue

Try to build QGIS 3.30.3 against exiv2 0.28

Versions

3.30.3

Supported QGIS version

  • [X] I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

ggardet avatar Jul 03 '23 15:07 ggardet

Likely because of https://github.com/Exiv2/exiv2/pull/2062

ggardet avatar Jul 03 '23 15:07 ggardet

See also full build.log in downstream bug report: https://bugs.gentoo.org/906470

Arch Linux use a non-upstreamed patch for >=3.30.3: https://gitlab.archlinux.org/archlinux/packaging/packages/qgis/-/blob/main/exiv2-0.28.patch

a17r avatar Jul 06 '23 09:07 a17r

@a17r Thanks for the link to the patch. Would be great if you could open a PR to upstream your patch. :)

ggardet avatar Jul 07 '23 06:07 ggardet

@ggardet well it is not my patch, but maybe @antonio-rojas would

a17r avatar Jul 07 '23 10:07 a17r

Replacing toLong() with toUInt32() in qgsexiftools.cpp (*) solves the problem in Linux (openSUSE Tumbleweed). Unsure if this will work in Windows too.

(*) https://github.com/qgis/QGIS/blob/master/src/core/raster/qgsexiftools.cpp

dhdeangelis avatar Jul 09 '23 06:07 dhdeangelis

Done in https://github.com/qgis/QGIS/pull/53762

antonio-rojas avatar Jul 09 '23 08:07 antonio-rojas

Closed with https://github.com/qgis/QGIS/pull/53762

Thanks @antonio-rojas

lbartoletti avatar Jul 18 '23 08:07 lbartoletti