include camera model and shorten exif stats

This adds a line to show the camera model and make, if available, and
reorders and cleans up the EXIF parameters extracted so they are more
readable for photographers (who are the ones who care about this
anyways).

Note that, as a photographer, I know what "Fstop" mean, but I would
expect "exposure" or the common f/X.Y notation. The "Focal" label
means nothing to me: "Focal length" would mean something, but it's
long - and what are the units? Just using "mm" here clarifies any
possible misunderstanding.

I have found this format to be way more readable. The following:

    ISO: 3200, Focal: 50, Exposure: 1/40, Fstop: 4.0
    Date: dimanche, 31. décembre 2017

Becomes:

    ISO 3200, 1/40s f/4.0, 50mm
    FUJIFILM X-T2
    dimanche, 31. décembre 2017

Now: dropping the explicit labels may be controversial, but I would
argue this is what markup is for. We could wrap those elements in
named <span> or <acronym> elements to provide more information through
mouse-over or CSS.
This commit is contained in:
Antoine Beaupré
2017-12-31 17:57:15 -05:00
parent 7e35d1fa40
commit 2e324123b6

View File

@@ -79,18 +79,21 @@
{%- if media.exif %}
<br>
{% if media.exif.iso %}ISO: {{ media.exif.iso }}, {% endif %}
{% if media.exif.focal %}Focal: {{ media.exif.focal }}, {% endif %}
{% if media.exif.exposure %}Exposure: {{ media.exif.exposure }}, {% endif %}
{% if media.exif.fstop %}Fstop: {{ media.exif.fstop }}{% endif %}
{% if media.exif.iso %}ISO {{ media.exif.iso }}, {% endif %}
{% if media.exif.exposure %}{{ media.exif.exposure }}s, {% endif %}
{% if media.exif.fstop %}f/{{ media.exif.fstop }}, {% endif %}
{% if media.exif.focal %}{{ media.exif.focal }}mm {% endif %}
{% if media.exif.gps %}
<br/>Location: <a href='https://www.openstreetmap.org/?mlat={{
media.exif.gps.lat }}&amp;mlon={{ media.exif.gps.lon}}&amp;zoom=12&amp;layers=M' target='_blank' class='map'
>{{ 'N{:.6f}'.format(media.exif.gps.lat) if media.exif.gps.lat > 0 else 'S{:.6f}'.format(-media.exif.gps.lat) }}
{{ 'E{:.6f}'.format(media.exif.gps.lon) if media.exif.gps.lon > 0 else 'W{:.6f}'.format(-media.exif.gps.lon) }}</a>
{% endif %}
{% if media.exif.Make or media.exif.Model %}
<br>{{ media.exif.Make }} {{ media.exif.Model }}
{% endif %}
{% if media.exif.datetime %}
<br>Date: {{ media.exif.datetime }}
<br>{{ media.exif.datetime }}
{% endif %}
{% endif %}
{%- endmacro %}