Skip to content

Adding an alt attribute causes incorrect sized image to load  #40

@tigerchick

Description

@tigerchick

This is an odd one that took me a while to track down.
Adding an alt attribute with any value to an img element causes an image to render at a low quality (the size it loads in at is too small at some but not all screen sizes - making it appear bad quality).
Removing the the alt attribute (or retaining it but with no value) fixes the issue.

The issue persists whether or not ci-params and/or ci-ratio are specified. If both these are removed, and the only things specified are ci-src and alt then the issue shows up. Remove alt and it goes away.

Given that specifying an alt tag is good for both accessibility and SEO, it would be good if this could be addressed please. I'm running js-cloudimage-responsive v4.9.0 with lazyLoading set to true with lazysizes - v5.3.2

Edit: The problem remains if I set lazyLoading to false.
Edit: Further testing reveals that this only happens when the img element is wrapped in an "a" element (in combination with there being an alt tag on the img)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions