Problem/Motivation
Many times, content editors may accidentally or on-purpose add images into the CKEditor (WYSIWYG) that are images linked relatively or absolutely.
Steps to reproduce
Add an absolute path linked image in the WYSIWYG and webp should log that there was an issue
Could not generate image resource from URI public://https:/your-domainTheImage@2x.png
In this example, it may also be some issue related to responsive image styles.
Proposed resolution
Skip the webp asset generation of absolute pathed images.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3406528-skip-absolute-image-paths-using-urlhelper.patch | 999 bytes | joshua.boltz |
| #2 | 3406528-skip-webp-generation-of-absolute-path-images.patch | 4.78 KB | joshua.boltz |
Comments
Comment #2
joshua.boltz commentedI've added a patch that skips webp generation of images that are absolute pathed.
Comment #3
joshua.boltz commentedComment #4
joshua.boltz commentedComment #5
joshua.boltz commentedI've updated this patch to use the UrlHelper::isExternal() method for checking the path. We check if the image path is external before WebP processing gets a handle of it. This avoids Webp having issues and giving errors like "Could not generate image resource" errors due to it not knowing how to deal with external image paths.
Comment #6
joshua.boltz commentedI messed up the last uploaded patch. I uploaded a new patch that includes the UrlHelper::isExternal() check of the image path. This way, Webp will skip the image if the image path is external, since it doesn't know what to do with external pathed images.
Comment #7
joshua.boltz commentedComment #8
m.abdulqader commentedComment #10
m.abdulqader commented