• Currently the images are shown in their maximum available (original) size –
    resulting in very long download times and traffic.
    The correct srcset should be used so the right thumbnail for the image is picked by browser.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author dFactory

    (@dfactory)

    Hi,
    You mean images displayed in lightbox or a gallery?

    Thread Starter strarsis

    (@strarsis)

    Hi,

    I mean the image displayed in the lightbox. When you inspect the image you will notice that its src points to the original image – even when the screen viewport is much smaller. This results in extreme loading times.

    Plugin Author dFactory

    (@dfactory)

    Not sure if srcset would work here – we’d need to check.

    But you have an option to control image sized used in lightbox – under gallery image size RL setting.

    Thread Starter strarsis

    (@strarsis)

    srcset/sizes would have the advantage that the browser can pick the right image file,
    depending on viewport and pixel density (hidpi/retina).
    srcset/sizes is well supported now by all browsers.

    srcset is already provided by WordPress.
    The proper sizes attribute has to be provided by the Lightbox markup generation
    so the browser knows the absolute image size in advance.
    E.g. when the image occupies the complete width of screen in the Lightbox,
    sizes="100vw" should be used.

    Plugin Author dFactory

    (@dfactory)

    Well, correct me if I’m wrong, but srcset is an img tag attribute.
    While the image displayed in lightbox comes href attribute of a link.

    So these two different things you just mixed in your question.

    Thread Starter strarsis

    (@strarsis)

    @dfactory: Correct, the Lightbox script itself would have to use the <img> element then – the link to original image file can’t be used because it is only the image file of maximum size.
    But when the target image can always only point to its own image file anyway, using the srcset-attribute of original <img> element should be just fine then?

    • This reply was modified 7 years, 4 months ago by strarsis.
    Plugin Author dFactory

    (@dfactory)

    Yea, but what would be lightbox effect for then?
    You see an image in original dimensions already.
    Doesn’t make much sense imo.

    Thread Starter strarsis

    (@strarsis)

    @dfactory: When the dimensions of the image are changed to viewport size (enlarged to screen in lightbox) and the sizes-attribute is adjusted, the browser will automatically download the right image file that fits to screen and pixel density. The original <img srcset="..."> can be used for this as WordPress already inserted all the generated thumbnails of different size the browser can choose from.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Missing srcset support’ is closed to new replies.