{{# @name Picture (Legacy) @desc Legacy Antlers implementation for backward compatibility with srcset_from and skip_ratio_steps. @deprecated Use the new {{ picture }} tag without these parameters instead. #}} {{ if image }} {{ asset :url="image" }} {{# Configure aspect ratio's. #}} {{ ratio = null }} {{ ratio_large = null }} {{ aspect_ratio | trim | explode(' ') }} {{ if value | contains('large:') }} {{ aspect = value | explode(':') | last }} {{ ratio_large = (aspect | explode('/') | last) / (aspect | explode('/') | first) }} {{ elseif value != '' }} {{ ratio = (value | explode('/') | last) / (value | explode('/') | first) }} {{ /if }} {{ /aspect_ratio }} {{ width && height ?= (original_ratio = height / width) }} {{# Initialize srcset variable in current scope to be overwritable from partial below. #}} {{ srcset = null }} {{# Set srcset sizes. #}} {{ partial src="{ srcset_from ?: 'statamic-peak-tools::snippets/srcset_default' }" }} {{# Image formats. #}} {{ formats = formats ?? {config:statamic-peak-tools:picture:default_formats} }} {{ if extension == 'svg' || extension == 'gif' }} {{ else }} {{ foreach:formats as="format|mime_type" }} {{ /foreach:formats }} {{ /if }} {{ /asset }} {{ /if }}