Skip to content

Commit

Permalink
优化PNG格式的图像显示为黑色的问题 (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohu2002 authored Oct 27, 2024
1 parent 949374c commit 3d2009d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/class/io/io_dzz.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3d2009d

Please sign in to comment.