Dokuwiki: Extracting EXIF-GPS-Tags from images broken

Created on 31 Mar 2017  路  2Comments  路  Source: splitbrain/dokuwiki

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?

Bug Media Management

All 2 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

splitbrain picture splitbrain  路  4Comments

benbrunner picture benbrunner  路  6Comments

wangxu94 picture wangxu94  路  5Comments

ackbyte picture ackbyte  路  3Comments

epeios-q37 picture epeios-q37  路  4Comments