Page MenuHomePhabricator

update prefillLocation to use 1.18's improved EXIF handling for location / GPS data
Closed, ResolvedPublic

Description

Author: bhartshorne

Description:
The UploadWizard currently has a noop for prefillLocation with comments claiming that mediawiki's exif parsing is broken for GPS data. Exif handling in 1.18 is greatly improved; if the problems with location data handling have been fixed (and my naive inspection leads me to believe that they have), update UploadWizard to use this improved parsing to pull out location data and automatically identify the location in uploaded images.


Version: unspecified
Severity: normal
URL: http://www.mediawiki.org/wiki/Extension:UploadWizard/Location

Details

Reference
bz31253

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:48 PM
bzimport added a project: UploadWizard.
bzimport set Reference to bz31253.
bzimport added a subscriber: Unknown Object (MLST).

bhartshorne wrote:

Though I'm sure it will be easy to create .jpgs with gps data embedded, if you want a test image download the full rez copy of http://en.wikipedia.org/wiki/File:Northbrae_Tunnel.jpg. It has its location in the EXIF tags.

For verification, the exif tags themselves read:
GPSLatitudeRef: N
GPSLatitude: 37/1 5344/100 0/1
GPSLongitudeRef: W
GPSRongitude: 122/1 1642/100 0/1

When presented for human consumption, they should read:
37.8906°N, 122.2736°W

if the problems with location data handling have been fixed...

For reference, yes it has been fixed.

Note, in MediaWiki 1.18, we (internally) convert GPS data into a single decimal value (So if the latitude was 50° 57′ 49.8″ N, we'd store GPSLatitude = 50.9638339701 instead of exif's weird array thingy and seperate prop for direction)

That test image returns nice handy entries in the metadata dictionary during test upload on trunk:

gpslatitude 37.890666666667
gpslongitude -122.27366666667

However, the prefillLocation function doesn't mention where the data's supposed to get placed, and there don't appear to be any location fields sitting about to just plop them into.

Is it necessary to also devise location fields, some sort of output format, etc?

neilk wrote:

I wrote a spec for this back in January, when we were trying to hire Jeroen. We ended up not hiring him for this contract, for reasons which remain shrouded in bureaucracy.

http://www.mediawiki.org/wiki/Extension:UploadWizard/Location

Despite the length of the spec, I don't think it's a lot of time to develop this -- it's just describing pretty standard features that slippy-map APIs have, and how to display them.

Spiff, added that link to bug metadata.

neilk wrote:

Fixed, although it breaks if the altitude was included. See #32410, #32408

Gilles raised the priority of this task from High to Unbreak Now!.Dec 4 2014, 10:21 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to High.Dec 4 2014, 11:20 AM