Image
The image
object describes an image, including its URL, alt text, and dimensions.
Usage Example
{%- comment -%} Display an image with alt text and size {%- endcomment -%}
<img src="{{ image.url }}" alt="{{ image.alt }}" width="{{ image.width }}" height="{{ image.height }}">
Properties
ai_processed?
Returns whether the image has been processed by AI.
alt
Returns the alt text for the image.
aspect_ratio
Returns the aspect ratio of the image, e.g., 16:9.
attached_to_variant?
Returns whether the image is attached to a variant.
This is only available when the image is accessed through the following methods:
product.images
product.featured_image
orproduct.image
product.media
product.featured_media
description
Returns the description of the image.
file_extension
Returns the file extension of the image.
file_name
Returns the file name of the image.
file_size
Returns the size of the image.
height
Returns the height of the image in pixels.
id
Returns the unique id for this image.
mime_type
Returns the mime type of the image.
orientation
Returns the orientation of the image, e.g., landscape.
sort_order
Returns the sort order of the image.
tags
Returns the tags of the image.
title
Returns the title (alt) of the image.
type
Returns the type of the media.
url
Returns the URL of the image.
variants
Returns the variants the image is attached to.
This is only available when the image is accessed through the following methods:
product.images
product.featured_image
orproduct.image
product.media
product.featured_media
width
Returns the width of the image in pixels.