When trying to access some EXIF-tags of images like the tag GPSLongitude with the function tpl_img_getTag(), I expect three rational values as per the standard:
0x0004
4
GPSInfo
Exif.GPSInfo.GPSLongitude
Rational
Indicates the longitude. The longitude is expressed as three RATIONAL values giving the degrees, minutes, and seconds, respectively. When degrees, minutes and seconds are expressed, the format is ddd/1,mm/1,ss/1. When degrees and minutes are used and, for example, fractions of minutes are given up to two decimal places, the format is ddd/1,mmmm/100,0/1.
However, all I get is the literal string 'Array' 馃槥
When digging deeper and accessing the field directly with getExifField('GPSLatitude'), I get an array of three numbers, but these are three ints:
array (size=1)
2 =>
array (size=3)
'val' => int 2
'num' => int 2
'den' => int 1
However these do not represent a latitude in Berlin where the given Photo was taken.
So I assume that somewhere in \JpegMeta::_readIFD() there is a bug.
Are there tests for this class, so I know I don't breaking anything should I attempt to fix this?
There are no tests for this class and the original source has vanished. It might be a good idea to look for a replacement for this class alltogether than attempting to fix bugs in it.
I've been using exif_read_data(mediaFN($id), 0, true); to get coordinates from jpg
see: https://github.com/mprins/dokuwiki-plugin-spatialhelper/blob/master/helper/index.php#L202