From bd9239de5e8b90e0b9938f02f7d54cf5a1fe48ce Mon Sep 17 00:00:00 2001 From: Serhii Zlobin Date: Fri, 23 Jan 2026 15:58:10 +0200 Subject: [PATCH] Make image type detection case-insensitive --- snippets/image.liquid | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/snippets/image.liquid b/snippets/image.liquid index 79b04ff..7f31565 100644 --- a/snippets/image.liquid +++ b/snippets/image.liquid @@ -56,6 +56,7 @@ {% endcomment %} {%- assign image_url = image.url -%} +{%- assign image_url_lower = image_url | downcase -%} {%- assign image_url_mobile = image_mobile.url -%} {%- if image_url != blank or image_url_mobile != blank -%} @@ -243,14 +244,14 @@ {%- for type in featured_types -%} {%- assign image_type = '.' | append: type -%} - {%- if featured_type == '' and image_url contains image_type -%} + {%- if featured_type == '' and image_url_lower contains image_type -%} {%- assign featured_type = image_type -%} {%- break -%} {%- endif -%} {%- endfor -%} {% comment %} convert images to the most in-demand formats {% endcomment %} - {%- if featured_type != blank and image_url contains featured_type -%} + {%- if featured_type != blank and image_url_lower contains featured_type -%} {%- assign src_jpg = '' -%} {%- assign src_png = '' -%} {%- assign src_webp = '' -%}