Skip to Content

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

alt

The alt text for the image.

url

The URL of the image.

title

The title (alt) of the image.

description

The description of the image.

tags

The tags of the image.

ai_processed?

Whether the image has been processed by AI.

width

The width of the image.

height

The height of the image.

aspect_ratio

The aspect ratio of the image, e.g. 16:9.

mime_type

The mime type of the image.

file_extension

The file extension of the image.

file_size

The size of the image.

file_name

The file name of the image.

orientation

The orientation of the image, e.g. landscape.

sort_order

The sort order of the image.

type

The type of the media.

attached_to_variant?

Whether the image is attached to a variant. This only available when image is access through following methods:

  • product.images
  • product.featured_image or product.image
  • product.media
  • product.featured_media

variants

The variants the image is attached to. This only available when image is access through following methods:

  • product.images
  • product.featured_image or product.image
  • product.media
  • product.featured_media