Author: overlordq
Description:
I noticed this today when a user came into #mediawiki and missing EXIF information.
The tags in question were the GPSLatitude, GPSLongitude, etc. After looking through the code, and then looking through the EXIF spec, it appears that the MW Exif handler does not gracefully handle tags which are arrays.
Pulling up the spec: http://www.digicamsoft.com/exif22/exif22/html/exif22_22.htm?gInitialPosX=10px&gInitialPosY=10px&gZoomValue=100
And looking at for example at BitsPerSample, with type short and count of 3. AFAIK, this means that BitsPerSample should be an array of 3 shorts. Unfortunately Exif.php doesn't handle this.
After turning on debugging and uploading a GPS tagged image, this output was obtained:
Exif::validate: tag is 'GPSLatitude' (type: array; content: 'Array
(
[0] => 36/1 [1] => 3/1 [2] => 5896/100
)
')
Exif::isRational: fed a non-fraction value (type: array; content: 'Array
(
[0] => 36/1 [1] => 3/1 [2] => 5896/100
)
')
Exif::makeFilteredData: 'GPSLatitude' contained invalid data (type: array; content: 'Array
(
[0] => 36/1 [1] => 3/1 [2] => 5896/100
)
')
Looking at the the source on line 470: http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Exif.php?annotate=23531
it explicitly disallows arrays.
Marking critical as although minor, EXIF tagged data in images can and is being lost.
Version: 1.12.x
Severity: normal
URL: http://commons.wikimedia.org/wiki/File:2005-09-17_10-01_Provence_641_St_R%C3%A9my-de-Provence_-_Glanum.jpg