Skip to content

[BUGFIX] Use the rendered width for srcset descriptors - #104

Merged
achimfritz merged 1 commit into
b13:masterfrom
wazum:bugfix/srcset-width-descriptors
Sep 29, 2026
Merged

achimfritz merged 1 commit into
b13:masterfrom
wazum:bugfix/srcset-width-descriptors

Conversation

@wazum

@wazum wazum commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Variants were labelled with the requested width, so a candidate the processor could not deliver at that size still claimed it. With processor_allowUpscaling off, an 800px original asked for five variants produced five candidates pointing at the same file under five different descriptors, and the browser dropped all but one of them as repeated width descriptors.

The descriptor now comes from the processed image, and a width that is already in the srcset is skipped. Where the requested width can be delivered, which is the normal case, the output is unchanged.

The functional test runs with upscaling disabled and uses its own fixture rather than storage_with_file.csv, because it needs a sys_file_metadata row: a processed file that falls back to the original carries no dimensions of its own and reads them from the original's metadata.

Fixes: #103

@achimfritz achimfritz self-assigned this Sep 22, 2026

@achimfritz achimfritz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , thanks

@achimfritz
achimfritz merged commit 3c07919 into b13:master Sep 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid srcset: width descriptors use the requested width, not the rendered width

2 participants