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.

Comments

joshua.boltz created an issue. See original summary.

joshua.boltz’s picture

I've added a patch that skips webp generation of images that are absolute pathed.

joshua.boltz’s picture

Status: Active » Needs review
joshua.boltz’s picture

joshua.boltz’s picture

I'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.

joshua.boltz’s picture

I 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.

joshua.boltz’s picture

m.abdulqader’s picture

  • 325a1508 committed on 2.0.x
    Issue #3406528 by joshua.boltz, m.abdulqader: Skip generating of webp...
m.abdulqader’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.