From 4e7e6048deb67a6e35cf94f356396ac05b869e5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 May 2021 15:42:49 +0200 Subject: [PATCH] Debug generation of webp --- htdocs/core/tpl/filemanager.tpl.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index f06d1806fe2..c98dcec2a43 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -202,10 +202,13 @@ if ($action == 'convertimgwebp' && $permtoadd) { if (!(substr_compare($filepath, 'webp', -strlen('webp')) === 0)) { if (image_format_supported($filepath) == 1) { $filepathnoext = preg_replace("/\..*/", "", $filepath); - $result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp', 90); - if (!dol_is_file($result)) { - $error++; - setEventMessages($result, null, 'errors'); + + if (! dol_is_file($filepathnoext.'.webp')) { // If file does not exists yet + $result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp', 90); + if (!dol_is_file($result)) { + $error++; + setEventMessages($result, null, 'errors'); + } } } }