godaddy-wordpress / block-gallery

WordPress gallery blocks built exclusively for Gutenberg
https://wpblockgallery.com
GNU General Public License v2.0
57 stars 13 forks source link

Add width and height attributes to images #12

Closed richtabor closed 4 years ago

richtabor commented 5 years ago

There's a request to add height and width attributes to images within galleries so that they could work better with lazy loading plugins.

Related: https://github.com/florianbrinkmann/lazy-loading-responsive-images/issues/18

josias-r commented 5 years ago

I once worked on a mediaUpload Element, where I wanted to optimize the Image sizes. What I found was the onSelect() callback function which has a media parameter where I could find the different sizes. Maybe that could help you. related stackexchange question