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:
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user