Debug generation of webp

This commit is contained in:
Laurent Destailleur 2021-05-01 15:42:49 +02:00
parent 99d655b983
commit 4e7e6048de

View File

@ -202,6 +202,8 @@ if ($action == 'convertimgwebp' && $permtoadd) {
if (!(substr_compare($filepath, 'webp', -strlen('webp')) === 0)) { if (!(substr_compare($filepath, 'webp', -strlen('webp')) === 0)) {
if (image_format_supported($filepath) == 1) { if (image_format_supported($filepath) == 1) {
$filepathnoext = preg_replace("/\..*/", "", $filepath); $filepathnoext = preg_replace("/\..*/", "", $filepath);
if (! dol_is_file($filepathnoext.'.webp')) { // If file does not exists yet
$result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp', 90); $result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp', 90);
if (!dol_is_file($result)) { if (!dol_is_file($result)) {
$error++; $error++;
@ -209,6 +211,7 @@ if ($action == 'convertimgwebp' && $permtoadd) {
} }
} }
} }
}
if ($error) { if ($error) {
break; break;
} }