How to deal with images having srcSet attributes
« on: February 17, 2022, 09:22:34 AM »
Hello,

I have discovered an "issue" as also mentioned in older posts:

https://www.xml-sitemaps.com/forum/index.php/topic,9177.html



I have this setup in basically all my images as it is the current state of art of front end dev to deliver different image sizes to the end user:

Code: [Select]
<img src="{domain}image-small.jpg" srcset="{domain}image-small.jpg w300, {domain}image-medium.jpg w600, {domain}image-big.jpg 1000w">

My generated images sitemap looks as follows (obfuscated the domain), where the spaces and size width triggers are parsed. But the src attribute is not parsed at all, SG only parses the srcSet.

Code: [Select]
<image:loc>{domain...}thumb.jpg%20320w,%20{domain...}-thumb.jpg%20768w,%20{domain...}-thumb.jpg%201024w,%20{domain...}-thumb-x2.jpg%201600w</image:loc>

I assume this is not a valid sitemap xml for the search engines.

⁇ Any solution or workaround I can implement ⁇