{% if entry.header.location_city or entry.header.location_country %}
·
{%- set _loc = [] -%}
{%- if entry.header.location_city -%}{%- set _loc = _loc|merge([entry.header.location_city]) -%}{%- endif -%}
{%- if entry.header.location_country -%}{%- set _loc = _loc|merge([entry.header.location_country]) -%}{%- endif -%}
{{ _loc|join(', ') }}
{% endif %}
{% if entry.header.weather_desc %}
· {{ weather_icons[entry.header.weather_desc|lower]|default('')|raw }} {{ entry.header.weather_desc }}
{% endif %}
{% set images = entry.media.images %}
{% if images|length > 0 %}
{#
Lightbox slides link to a 2000px fit-within DERIVATIVE, and the
data-pswp-* dims are measured from that derivative's saved file — never
from `img.width`/`img.height`, which are the ORIGINAL's raw stored pixels
with EXIF orientation ignored. Originals from iPhones are often stored
rotated (landscape pixels + EXIF "rotate 90°"), so raw dims disagree with
what the browser renders and PhotoSwipe squeezes portraits into landscape
boxes (BUG 2026-07-09, covered by tests/ui/post/lightbox-dims.spec.js).
The derivative is re-encoded (EXIF stripped, orientation baked in when
php-exif is available), so its measured dims always match its rendering.
Note: .path()/.url each finalize+reset the medium's operation queue,
hence the repeated cropResize() calls — the derivative file itself is
cached. path() needs explicit parens: Medium is ArrayAccess and carries a
'path' ITEM (the page folder), which shadows the method in Twig's
attribute resolution and hands getimagesize a directory.
#}
{% set firstDims = (images|first).cropResize(2000, 2000).path()|getimagesize %}
{% set wrapRatio = firstDims[1] > firstDims[0] ? '4 / 5' : '4 / 3' %}
{% for img in images %}
{% set slideDims = img.cropResize(2000, 2000).path()|getimagesize %}
{% endfor %}