Pong

## October 21th 2014, libexif

It has turned out that Qt 5.4 does not support EXIF tags on Android. So we need to use a third-party library like Exiv2 to manipulate EXIF tags.

Using the Exiv2 library to geo-tag an image is straight forward. It is, however, not so easy to include the library into a Qt project that should get deployed on Android. This is because it has a dependency to libexpat and zlib.

An alternative to Exiv2 is libexif, which is pure plain C:

Let’s first build the command line tool of libexif named “exif”. We need to download and compile the libexif-0.6.21.tar.gz tarball and the exif-0.6.21.tar.gz tar ball.

Then we try to reproduce the Exiv2 example with libexiv:

exif -c --tag=GPSAltitude --ifd=GPS --set-value="884443 100" MtEverest.jpg -o MtEverest.geotagged.jpg


Unfortunately, the exif tool tells us that “Setting a value for this tag is unsupported!”. The library should in theory support setting the GPS tag on the above file, but well, in practice it somehow doesn’t. Maybe we made a mistake, but anyhow it seems like we are not getting any further with libexif.

Instead we revisit libexiv2 to see if we can include it into our Android project without including even more dependencies like libexpat and zlib. Fortunately, it turns out that we can get rid of its dependencies by configuring it like that:

/configure --disable-xmp --without-zlib