1、/admin/model/tool/image.php 增加 IMAGETYPE_WEBP
if (!in_array($image_type, array(IMAGETYPE_PNG, IMAGETYPE_JPEG, IMAGETYPE_GIF, IMAGETYPE_WEBP))) { return DIR_IMAGE . $image_old;}
2、admin/controller/common/filemanager.php 增加webp
$files = glob($directory . '/' . $filter_name . '*.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF,webp}', GLOB_BRACE);
$allowed = array('jpg','jpeg','gif','png','webp');if (!in_array(utf8_strtolower(utf8_substr(strrchr($filename, '.'), 1)), $allowed)) {$json['error'] = $this->language->get('error_filetype');}// Allowed file mime types$allowed = array('image/jpeg','image/pjpeg','image/png','image/x-png','image/gif','image/webp');
3、/system/library/image.php
if ($this->mime == 'image/gif') {$this->image = imagecreatefromgif($file);} elseif ($this->mime == 'image/png') {$this->image = imagecreatefrompng($file);} elseif ($this->mime == 'image/jpeg') {$this->image = imagecreatefromjpeg($file);} elseif ($this->mime == 'image/webp') {$this->image = imagecreatefromwebp($file);}