浏览代码

Fix : image convertion to webp for websites

Hystepik 2 年之前
父节点
当前提交
a7a90743b5
共有 1 个文件被更改,包括 6 次插入9 次删除
  1. 6 9
      htdocs/core/tpl/filemanager.tpl.php

+ 6 - 9
htdocs/core/tpl/filemanager.tpl.php

@@ -240,15 +240,12 @@ if ($action == 'convertimgwebp' && $permtoadd) {
 		if (!(substr_compare($filepath, 'webp', -strlen('webp')) === 0)) {
 			if (image_format_supported($filepath) == 1) {
 				$filepathnoext = preg_replace("/\.[a-z0-9]+$/i", "", $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);
-					if (!dol_is_file($result)) {
-						$error++;
-						setEventMessages($result, null, 'errors');
-					} else {
-						$nbconverted++;
-					}
+				$result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp', 90);
+				if (!dol_is_file($result)) {
+					$error++;
+					setEventMessages($result, null, 'errors');
+				} else {
+					$nbconverted++;
 				}
 			}
 		}