Skip to content

Commit

Permalink
增加ZC_THUMB_IMAGE_FILL设置;
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowsoft committed Aug 3, 2024
1 parent c650849 commit e5f7cf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
1 change: 1 addition & 0 deletions zb_system/defend/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
'ZC_JS_304_ENABLE' => true,
'ZC_DELMEMBER_WITH_ALLDATA' => false,
'ZC_THUMB_DEFAULT_QUALITY' => 90,
'ZC_THUMB_IMAGE_FILL' => true,
'ZC_FIX_MODULE_MIXED_FILENAME' => true,

// API 相关
Expand Down
28 changes: 2 additions & 26 deletions zb_system/function/lib/thumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,19 +414,7 @@ protected function clip($clipx, $clipy, $clip_width, $clip_height)

$this->tmpRes = imagecreatetruecolor($clip_width, $clip_height);

$ml = ini_get('memory_limit');
$ml = str_ireplace('m', '000000', $ml);
$ml = str_ireplace('g', '000000000', $ml);
$ml = (int) $ml;
if ($this->srcWidth * $this->srcHeight > 8000000) {
if ($ml > 90000000) {
imagefill($this->tmpRes, 0, 0, 0xffffff);
}
} elseif ($this->srcWidth * $this->srcHeight > 2000000) {
if ($ml > 30000000) {
imagefill($this->tmpRes, 0, 0, 0xffffff);
}
} else {
if (defined('ZC_THUMB_IMAGE_FILL') && ZC_THUMB_IMAGE_FILL == true) {
imagefill($this->tmpRes, 0, 0, 0xffffff);
}

Expand Down Expand Up @@ -471,19 +459,7 @@ public function zoom($forced_width, $forced_height = 0)

$this->tmpRes = imagecreatetruecolor($dst_width, $dst_height);

$ml = ini_get('memory_limit');
$ml = str_ireplace('m', '000000', $ml);
$ml = str_ireplace('g', '000000000', $ml);
$ml = (int) $ml;
if ($this->srcWidth * $this->srcHeight > 8000000) {
if ($ml > 90000000) {
imagefill($this->tmpRes, 0, 0, 0xffffff);
}
} elseif ($this->srcWidth * $this->srcHeight > 2000000) {
if ($ml > 30000000) {
imagefill($this->tmpRes, 0, 0, 0xffffff);
}
} else {
if (defined('ZC_THUMB_IMAGE_FILL') && ZC_THUMB_IMAGE_FILL == true) {
imagefill($this->tmpRes, 0, 0, 0xffffff);
}

Expand Down

0 comments on commit e5f7cf4

Please sign in to comment.