Incorrect Alter HTML when webp larger than original?
-
I think WebpExpress behaves incorrectly in the following scenario:
Scope=all content
Destination folder=mingled
File extension=set
Destination structure=document root
>> Prevent using webps larger than original = YES>> Alter HTML = YES
Replace img with picture, adding webp to srcset
>> Reference webps that haven’t been converted yet = YESIn this setup everything seems to work, so upload/xxx.png gets corresponding upload/xxx.webp, and everything is peachy. However, I noticed that there are several cases where in addition to upload/xxx.png and upload/xxx.webp, I now have xxx.png.webp generated under wp-content/webp-express/webp-images/doc-root/wp-content/uploads. Investigation indicates that these are the cases when generated uploads/xxx.webp is bigger than uploads/xxx.png. When getWebPUrl tries all image roots, ‘upload’ root fails because of the size, but subsequent ‘wp-content’ succeeds as we allow references to not-yet-existing webps. And then alter HTML creates these weird srcsets:
srcset=”<redacted>wp-content/webp-express/webp-images/doc-root/wp-content/uploads/2019/03/xxx.png.webp 410w, <redacted>/wp-content/uploads/2019/03/xxx-300×136.webp 300w”
The second one (300×136) is fine, and I am not sure how it supposed to work in this scenario (as only one item in srcset fails size restriction). But I am pretty sure it’s not correct/expected behavior.
- The topic ‘Incorrect Alter HTML when webp larger than original?’ is closed to new replies.