Browse Source

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

pull/264/head
小胡 7 months ago
committed by GitHub
parent
commit
3d2009dc4c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      core/class/io/io_dzz.php

7
core/class/io/io_dzz.php

@ -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;

Loading…
Cancel
Save