You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Modern Image Formats - wp_calculate_image_srcset => false => no SOURCE element #2191
I found that if you turn off srcset, the source element with AVIF is not added to the image.
AVIF - Generate images in this format
✓ Also generate fallback images in the original upload format
✓ Generate all fallback image sizes including custom sizes
✓ Use < picture > Element (experimental)
Hmm, I’m not able to replicate the bug, but with the wp_calculate_image_srcset filter returning false, the <img> tag only has the src attribute with the fallback JPG image, and the <source> tag is generated with only one src in the srcset. See below:
When the Use <picture> Element (experimental) option is disabled, this is what gets generated the <img> tag has the src with the selected modern image format.
Activity
adamsilverstein commentedon Sep 26, 2025
Hi @1ucay - thanks for the bug report.
Sounds like a bug.
What happens if you turn off the Use < picture > Element (experimental) option?
b1ink0 commentedon Oct 8, 2025
Hmm, I’m not able to replicate the bug, but with the
wp_calculate_image_srcsetfilter returningfalse, the<img>tag only has thesrcattribute with the fallback JPG image, and the<source>tag is generated with only onesrcin thesrcset. See below:When the Use
<picture>Element (experimental) option is disabled, this is what gets generated the<img>tag has thesrcwith the selected modern image format.This issue is probably handled by the following
elselogic:performance/plugins/webp-uploads/picture-element.php
Lines 119 to 123 in 708b55d
When the
wp_calculate_image_srcsetfilter returnsfalse, thesrcsetisnull..
.
.
performance/plugins/webp-uploads/picture-element.php
Lines 153 to 164 in 708b55d
I believe this is the correct behavior, but I want other contributors to try to replicate it, I might be missing something.
cc: @adamsilverstein
1ucay commentedon Oct 30, 2025
I have to apologize to you all, it works fine with the filter.
adamsilverstein commentedon Nov 17, 2025
Thanks @1ucay - closing as this turned out to not be a bug.