Skip to content

Instantly share code, notes, and snippets.

@m42e
Created January 15, 2015 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m42e/c800eb4be47eb1788d87 to your computer and use it in GitHub Desktop.
Save m42e/c800eb4be47eb1788d87 to your computer and use it in GitHub Desktop.
import photos
import clipboard
import webbrowser
img = photos.pick_image(include_metadata=True)
meta=img[1]
gps = meta.get('{GPS}')
if gps:
latitude = str(gps.get('Latitude', 0.0)) + gps.get('LatitudeRef', '')
longitude =str(gps.get('Longitude', 0.0)) + gps.get('LongitudeRef', '')
clipboard.set('%s, %s' % (latitude, longitude))
else:
clipboard.set('Last photo has no location metadata.')
webbrowser.open('workflow://')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment