From 93019a9cecacf77dcae7d7fead96224af2498894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 4 Nov 2023 21:27:09 +0100 Subject: [PATCH] Fix image resize spaces (#806) --- templates/macros/images.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/macros/images.html b/templates/macros/images.html index 4f04333806..178dd179ab 100644 --- a/templates/macros/images.html +++ b/templates/macros/images.html @@ -2,12 +2,12 @@ {%- if path is ending_with(".svg") or path is ending_with(".gif") or path is ending_with(".webp") -%} {{- get_url(path=path) -}} {%- else -%} - {% set metadata = get_image_metadata(path=path, allow_missing=true) %} - {% if metadata %} + {%- set metadata = get_image_metadata(path=path, allow_missing=true) -%} + {%- if metadata -%} {%- set image = resize_image(path=path, width=width, height=height, op="fit") -%} {{- image.url -}} - {% else %} - assets/bevy_icon_dark.svg - {% endif %} + {%- else -%} + /assets/bevy_icon_dark.svg + {%- endif -%} {%- endif -%} {%- endmacro card %}