优化PNG格式的图像显示为黑色的问题 (#262)

This commit is contained in:
小胡 2024-10-27 15:32:12 +08:00 committed by GitHub
parent 949374c804
commit 3d2009dc4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -309,7 +309,12 @@ class io_dzz extends io_api
$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;