Browse Source

修复图片水印文字颜色,恢复缩略图条件,前台样式控制即可

develop
叙述、别离 3 weeks ago
parent
commit
5568ec1ec9
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/system/helpers/image.helper.php

+ 5
- 5
src/system/helpers/image.helper.php View File

@@ -84,8 +84,8 @@ if (!function_exists('WaterImg')) {
} }
$info = ''; $info = '';
$srcInfo = @getimagesize($srcFile, $info); $srcInfo = @getimagesize($srcFile, $info);
$srcFile_w = $srcInfo[0];
$srcFile_h = $srcInfo[1];
$srcFile_w = $srcInfo[0];
$srcFile_h = $srcInfo[1];
if ($srcFile_w < $photo_wwidth || $srcFile_h < $photo_wheight) { if ($srcFile_w < $photo_wwidth || $srcFile_h < $photo_wheight) {
return; return;
} }
@@ -112,8 +112,8 @@ if (!function_exists('WaterImg')) {
} }
$cfg_watermarktext['text'] = $photo_watertext; $cfg_watermarktext['text'] = $photo_watertext;
$cfg_watermarktext['size'] = $photo_fontsize; $cfg_watermarktext['size'] = $photo_fontsize;
$cfg_watermarktext['color'] = $photo_fontcolor;
$cfg_watermarktext['angle'] = '0'; $cfg_watermarktext['angle'] = '0';
$cfg_watermarktext['color'] = '255,255,255';
$cfg_watermarktext['shadowx'] = '0'; $cfg_watermarktext['shadowx'] = '0';
$cfg_watermarktext['shadowy'] = '0'; $cfg_watermarktext['shadowy'] = '0';
$cfg_watermarktext['shadowcolor'] = '0,0,0'; $cfg_watermarktext['shadowcolor'] = '0,0,0';
@@ -123,7 +123,7 @@ if (!function_exists('WaterImg')) {
} }
} }
/** /**
* 对空白地方填充满
* 对空白地方填充满
* *
* @access public * @access public
* @param string $srcFile 图片路径 * @param string $srcFile 图片路径
@@ -138,7 +138,7 @@ if (!function_exists('ImageResizeNew')) {
{ {
try { try {
$image = new ImageResize($srcFile); $image = new ImageResize($srcFile);
$image->resize($toW, $toH);
$image->resizeToBestFit($toW, $toH);
if ($issave) { if ($issave) {
$image->save($toFile); $image->save($toFile);
} else { } else {


Loading…
Cancel
Save