Debug generation of webp
This commit is contained in:
parent
99d655b983
commit
4e7e6048de
@ -202,10 +202,13 @@ 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);
|
||||||
$result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp', 90);
|
|
||||||
if (!dol_is_file($result)) {
|
if (! dol_is_file($filepathnoext.'.webp')) { // If file does not exists yet
|
||||||
$error++;
|
$result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp', 90);
|
||||||
setEventMessages($result, null, 'errors');
|
if (!dol_is_file($result)) {
|
||||||
|
$error++;
|
||||||
|
setEventMessages($result, null, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user