Gallery image size is not respected

Cwicly Plugin version: 1.2.9.4.4

Hi,

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.

image

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:

image

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)

Hi @Louis,

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 sizes :wink:
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?

Hello @yankiara,

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.

Cheers,

Hello @yankiara,

The sizes attribute as well as a few missing attributes when using the dynamic gallery have been added in 1.2.9.5.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.

Cheers,

1 Like

Hi @Louis,

It doesn’t seem to work for me… No change on image gallery block frontend.

Hi @yankiara,

Have you made sure to either re-save the page/regenerate HTML?

1 Like

Yes, and I tried with different combinations of lazyload/lightbox as well, no change.

UP, please, this is really important to prevent heavy page load.