From 3d2009dc4c0fc677e62b10342dc375604ce6859b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=83=A1?= <140248955+xiaohu2002@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:32:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96PNG=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E5=83=8F=E6=98=BE=E7=A4=BA=E4=B8=BA=E9=BB=91?= =?UTF-8?q?=E8=89=B2=E7=9A=84=E9=97=AE=E9=A2=98=20(#262)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/io/io_dzz.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/class/io/io_dzz.php b/core/class/io/io_dzz.php index 67e5c9a0..55b786f5 100644 --- a/core/class/io/io_dzz.php +++ b/core/class/io/io_dzz.php @@ -309,7 +309,12 @@ public function getThumb($path, $width = 0, $height = 0, $original = false, $ret $quality = 80; $imgcachePath = 'imgcache/'; $cachepath = str_replace('//', '/', str_replace(':', '/', $data['attachment'] ? $data['attachment'] : $data['path'])); - $target = $imgcachePath . ($cachepath) . '.' . $width . '_' . $height . '_'.$thumbtype.'.jpeg'; + if ($data['ext'] == 'png' || $data['ext'] == 'PNG') { + $targetext = '.png'; + } else { + $targetext = '.jpeg'; + } + $target = $imgcachePath . ($cachepath) . '.' . $width . '_' . $height . '_'.$thumbtype.$targetext; if (!$original && $enable_cache && @getimagesize($_G['setting']['attachdir'] . './' . $target)) { if ($returnurl) return $_G['setting']['attachurl'] . '/' . $target; $file = $_G['setting']['attachdir'] . './' . $target;