Read GPS coordinates from EXIF tags

If GPS information can be found in the EXIF tags, latitude and longitude will be
extracted and added to the `media.exif.gps` variable. Some ideas how to get the
GPS tags from the EXIF tags where borrowed from Eran Sandler's gist (licensed
under MIT license):

    https://gist.github.com/erans/983821
This commit is contained in:
Matthias Vogelgesang
2013-08-01 21:35:02 +02:00
parent 58a9c7d51a
commit 4940bbdc0c
2 changed files with 67 additions and 6 deletions

View File

@@ -234,6 +234,20 @@ templates. If available, you can use:
This will output something like "Monday, 25. June 2013", depending on your
locale.
``media.exif.gps``
If not None, the dict contains two keys ``lat`` and ``lon`` denoting the
GPS coordinates of the location where the image was taken. ``lat`` will
always be referenced to the north pole whereas ``lon`` will be referenced to
east to the prime meridan. To provide a link on an OpenStreetMap you could
write a template like this:
.. code-block:: jinja
{% if media.exif.gps %}
<a href="http://openstreetmap.org/index.html?lat={{
media.exif.gps.lat }}&lon={{ media.exif.long}}">Go to location</a>
{% endif %}
.. _album-information-label: