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,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');
}
}
}
}