썸네일 라이브러리 코드 수정

This commit is contained in:
thisgun
2018-12-26 15:48:23 +09:00
parent 129da34249
commit 3efa500b02

View File

@ -25,29 +25,31 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
$matches = get_editor_image($write['wr_content'], false); $matches = get_editor_image($write['wr_content'], false);
$edt = true; $edt = true;
for($i=0; $i<count($matches[1]); $i++) if(isset($matches[1]) && is_array($matches[1])){
{ for($i=0; $i<count($matches[1]); $i++)
// 이미지 path 구함 {
$p = parse_url($matches[1][$i]); // 이미지 path 구함
if(strpos($p['path'], '/'.G5_DATA_DIR.'/') != 0) $p = parse_url($matches[1][$i]);
$data_path = preg_replace('/^\/.*\/'.G5_DATA_DIR.'/', '/'.G5_DATA_DIR, $p['path']); if(strpos($p['path'], '/'.G5_DATA_DIR.'/') != 0)
else $data_path = preg_replace('/^\/.*\/'.G5_DATA_DIR.'/', '/'.G5_DATA_DIR, $p['path']);
$data_path = $p['path']; else
$data_path = $p['path'];
$srcfile = G5_PATH.$data_path; $srcfile = G5_PATH.$data_path;
if(preg_match("/\.({$config['cf_image_extension']})$/i", $srcfile) && is_file($srcfile)) { if(preg_match("/\.({$config['cf_image_extension']})$/i", $srcfile) && is_file($srcfile)) {
$size = @getimagesize($srcfile); $size = @getimagesize($srcfile);
if(empty($size)) if(empty($size))
continue; continue;
$filename = basename($srcfile); $filename = basename($srcfile);
$filepath = dirname($srcfile); $filepath = dirname($srcfile);
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matches[0][$i], $malt); preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matches[0][$i], $malt);
$alt = get_text($malt[1]); $alt = get_text($malt[1]);
break; break;
}
} }
} }
} }