Page MenuHomePhabricator

MediaWiki can not handle "rational" altitude info from EXIF
Closed, ResolvedPublic

Description

When uploading pictures with EXIF altitude info stored as a rational value (like "4205/100"), UploadWizard imports that data without trying to convert it, then refuses to finish the upload because the value is not a decimal one.


Version: unspecified
Severity: normal

Details

Reference
bz35015

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:15 AM
bzimport set Reference to bz35015.
bzimport added a subscriber: Unknown Object (MLST).

This is likely probably not UW specific, and it's probably the core metadata extraction code hasn't had an exception put in for Altitude..

public function testGPSExtraction() {

		$filename = $this->mediaPath . 'exif-gps.jpg';
		$seg = JpegMetadataExtractor::segmentSplitter( $filename ); 
		$exif = new Exif( $filename, $seg['byteOrder'] );
		$data = $exif->getFilteredData();
		$expected = array(
			'GPSLatitude' => 88.5180555556,
			'GPSLongitude' => -21.12357,
			'GPSAltitude' => -200,
			'GPSDOP' => '5/1',
			'GPSVersionID' => '2.2.0.0',
		);
		$this->assertEquals( $expected, $data, '', 0.0000000001 );

}

suggests it's looking for a number, not a fraction...

This is bug 32410 (Which is apparently assigned to me, which i didn't even know until just right now until i was looking for it to dupe this bug to it).

Really I think the bug here is with UploadWizard, and the bug with core exif support is that it sometimes gets converted to a decimal, where it should never be... Meh, I should probably just change the exif support to do what UploadWizard wants.

  • This bug has been marked as a duplicate of bug 32410 ***