|
|
|
@ -546,8 +546,13 @@ Class SiteController extends Controller {
@@ -546,8 +546,13 @@ Class SiteController extends Controller {
|
|
|
|
|
|
|
|
|
|
//保存base64格式的缩略图到缓存文件 |
|
|
|
|
if (!empty($imgSource)) { |
|
|
|
|
$dst_img = imagecreatetruecolor($width, $height); |
|
|
|
|
$copy_done = imagecopyresampled($dst_img, $imgSource, 0, 0, 0, 0, $width, $height, $naturalWidth, $naturalHeight); |
|
|
|
|
//方法1: 使用imagecopyresampled复制部分图片 |
|
|
|
|
//$dst_img = imagecreatetruecolor($width, $height); |
|
|
|
|
//$copy_done = imagecopyresampled($dst_img, $imgSource, 0, 0, 0, 0, $width, $height, $naturalWidth, $naturalHeight); |
|
|
|
|
|
|
|
|
|
//方法2: 直接缩小图片 |
|
|
|
|
$dst_img = imagescale($imgSource, $width, $height, IMG_CATMULLROM); |
|
|
|
|
$copy_done = !empty($dst_img) ? true : false; |
|
|
|
|
if ($copy_done) { |
|
|
|
|
ob_start(); |
|
|
|
|
$quality = !empty(FSC::$app['config']['smallImageQuality']) ? FSC::$app['config']['smallImageQuality'] : 90; |
|
|
|
|