ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Add Responsive image feature to core

Open austriker27 opened this issue 2 years ago • 1 comments

Hey all,

I'd love to see a responsive image feature out of the box with statamic (I know, and have used, the addons like Spatie's great addon).

Inspirations to look at:

This feature doesn't have to be a replacement for packages like Spatie's, but perhaps in an ideal world it would.

I know a lot of this is possible to write by hand with Glide, but it would be nice if core did it.

Thanks! ✌🏻

austriker27 avatar May 17 '22 22:05 austriker27

Nuxt also has a great first-party module for this. Link

joshuablum avatar May 18 '22 11:05 joshuablum

I would love this and to be able to define presets using ratios (e.g. 3/2) instead of exact dimensions (e.g. 300w 200h) - Responsive sizes could be automatically calculated from these ratios. At the moment we can only calculate responsive dimensions manually and that could mean adding 5 or 6 responsive presets for every image shape. For one of my websites that would require 30+ presets.

Spatie's package uses ratios but it doesn't have presets, which creates a few problems - The biggest one being that images can only be generated on request, which means occasionally server freezes / crashes. Also, Glide filenames are not pretty when manipulated on the fly (bad for SEO).

This feature would be good for everyone and for the environment. Better optimisation, less bandwidth required.

stuartcusackie avatar Jan 30 '23 11:01 stuartcusackie