v2-hub icon indicating copy to clipboard operation
v2-hub copied to clipboard

`assets` template tag should define a variable with image ratio

Open efoken opened this issue 7 years ago • 0 comments

Expected behaviour

When using image assets, I often need the image ratio, for calculating stuff in JS or whatever. I ended up using {{ width | divide:height }} everywhere in my code, but it would be much easier if the assets tag defines a ratio variable containg the pre-calculated value.

Actual behaviour

It doesn't.

Server Details

Operating System: macOS

Web Server: Nginx

PHP Version: 7.2.5

Statamic Version: 2.8.12

Updated from an older Statamic or fresh install: Updated

efoken avatar May 04 '18 06:05 efoken