//大图路径(此处大图路径可参考上篇 “使用ThinkPHP实现附件上传”的上传路径)
$bigimg_path
=
$upload
->rootPath.
$file_info
[
'savepath'
].
$file_info
[
'savename'
];
//小图路径
$smallimg_path
=
$upload
->rootPath.
$file_info
[
'savepath'
].
'small_'
.
$file_info
[
'savename'
];
$img
=
new
\Think\Image();
//实例化
$img
->open(
$bigimg_path
);
//打开被处理的图片
$img
->thumb(100,100);
//制作缩略图(100*100)
$img
->save(
$smallimg_path
);
//保存缩略图到服务器