Cwicly Plugin version: 184.108.40.206.4
On frontend, gallery image files are loaded according to screen width even if an intermediate size has been selected because all srcset are included, resulting in huge bandwith for large screen.
Only srcset BELOW selected size should be included here.
NOTE: Related to Image size is not respected on frontend because of wrong srcset
I actually think I was wrong and the issue is not full srcset, but rather the combination of width / height attribute values and width / height gallery CSS and full srcset:
That’s why I guess setting width and height attributes with selected file size dimensions is better.
You force the file you need and you play with CSS sizes.
(See Image size (if srcset is removed or not) - #5 by yankiara)
Sorry to insist, but this is pretty critical to me in some cases, and I think I found out the issue:
It looks like
sizes attribute is not generated for galleries images in addition to
srcset, like you do for standard images.
So even on mobile, full size images are loaded.
In addition to this, I think we could go even further by taking into acount the number of columns in gallery to generate
Because even with
sizes defined as you do in standard images, big size images will be loaded on desktop even if displayed on 4 columns, so with small size (sizes based on screen widths).
So maybe for each breakpoint, each size in
sizes should be divided by the number of columns?
Thanks for bringing this up again and sorry for not responding to it, it somehow was missed on my list.
I’ll review this in the next few days and will update accordingly.
sizes attribute as well as a few missing attributes when using the dynamic gallery have been added in 220.127.116.11.8.3.
We’re still looking into using a more precise
sizes attribute as describe in your post.
Thanks for your patience on this one.
It doesn’t seem to work for me… No change on image gallery block frontend.
Have you made sure to either re-save the page/regenerate HTML?
Yes, and I tried with different combinations of lazyload/lightbox as well, no change.