dever %!s(int64=6) %!d(string=hai) anos
pai
achega
10c68b9d96
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/Store/Core.php

+ 6 - 0
src/Store/Core.php

@@ -197,8 +197,14 @@ class Core
 			$this->data['file']['tmp_name'] = $path . $this->data['file']['name'];
 
 			if (!is_file($this->data['file']['tmp_name'])) {
+				if (strstr($name, 'tp=webp')) {
+					$name = str_replace('tp=webp', 'tp=jpeg', $name);
+				} elseif (strstr($name, '.webp')) {
+					$name = str_replace('.webp', '.jpg', $name);
+				}
 				$file = Dever::curl($name);
 				if (stristr($file, 'webp')) {
+					# 将webp图片转成jpg
 					$this->ext = '.jpg';
 				}
 				file_put_contents($this->data['file']['tmp_name'], $file);