From 6e580f71e174a81c24ab4b72322105468b1200c9 Mon Sep 17 00:00:00 2001 From: horst-n Date: Sat, 4 May 2019 18:42:11 +0200 Subject: [PATCH] changed the return of webpUrl() to return the calculated URL, even if there is no webp copy available! --- wire/core/Pageimage.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wire/core/Pageimage.php b/wire/core/Pageimage.php index a0601854..82baba46 100644 --- a/wire/core/Pageimage.php +++ b/wire/core/Pageimage.php @@ -181,15 +181,12 @@ class Pageimage extends Pagefile { } /** - * Return the web accessible URL to this image files webP dependency + * Return the web accessible URL to this image files webP dependency, also if no webp copy exists! * * @return string * */ public function webpUrl() { - if(!$this->hasWebp()) { - return '#'; // @Ryan: what should be returned for none existing webp variations here? - } $path_parts = pathinfo($this->url); $webpUrl = $path_parts['dirname'] . '/' . $path_parts['filename'] . '.webp'; return $webpUrl;