Possible to get image dimensions in liquid?

Shopify Partner
115 0 7

Is it possible to get an images dimensions or aspect ratio in liquid?

For instance if I had an image stored in settings like this: `{{ settings.bg_img.png }}`.

This would be for use with sass in a situation where it would be much easier to accomplish something if the image dimensions were available.

Shopify Expert
9778 86 1526

Hey Halley,

There's currently no method that lets you get the image dimension (and in turn ratios) in Liquid. You'd need to rely on JavaScript approaches here.

If the images are added via an app you could add the dimensions / ratio to the image as metafield value so they are there to access later.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au