mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00
🐛 fix: handle missing image metadata gracefully
This commit is contained in:
parent
be8ec45c35
commit
b5b50cdefb
4 changed files with 5 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
{% set light_meta = get_image_metadata(path=light_src) %}
|
||||
{% set dark_meta = get_image_metadata(path=dark_src) %}
|
||||
{% set light_meta = get_image_metadata(path=light_src, allow_missing=true) %}
|
||||
{% set dark_meta = get_image_metadata(path=dark_src, allow_missing=true) %}
|
||||
<img src="{{ get_url(path=light_src) }}" {% if alt %}alt="{{ alt }}" {% endif %} {% if light_meta.width %}width="{{ light_meta.width }}" {% endif %} {% if light_meta.height %}height="{{ light_meta.height }}" {% endif %} class="img-light">
|
||||
<img src="{{ get_url(path=dark_src) }}" {% if alt %}alt="{{ alt }}" {% endif %} {% if dark_meta.width %}width="{{ dark_meta.width }}" {% endif %} {% if dark_meta.height %}height="{{ dark_meta.height }}" {% endif %} class="img-dark">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue