
缺点:长宽不一的图片会被拉伸变形,不能智能裁切,需要智能裁切的,请自行研究。
$config = array();
$config[path] = “./”;
$config[t_width] = 120;
$config[t_height] = 98;
$config[ignore] = array(“”,”.”,”..”);
$config[prefix] = “thumb_”;
$done = 0;
define(“IMAGE_JPG”, 2);
define(“ENDL”, “n”);
if($handle = opendir($config[path])) {
while(false !== ($file = readdir($handle))) {
if(!array_search($file,$config[ignore])) {
list($im_width, $im_height, $type) = getimagesize($file);
if($type != IMAGE_JPG) {
continue;
}
$op .= “found –
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...