Generated asset derivatives should store the dimensions of the generated image

Description

It has always been best practice to include width and height attributes on HTML <img> elements; this will become even more desirable with browser developments regarding image aspect-ratio:

https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/

However, Preside has not previously included these because it doesn't know what the dimensions of a generated image are, leaving the browser to size the image once it's loaded.

We should persist height and width attributes on asset_derivative records once the transformations are completed (they already exist on the raw asset record). This will allow developers to use this information as they see fit when rendering the asset.

Assignee

Seb Duggan

Reporter

Seb Duggan

Labels

None

Accepted

Yes

Fix versions

Priority

Medium
Configure