Skip to content

Commit

Permalink
썸네일 라이브러리 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Dec 26, 2018
1 parent 129da34 commit 3efa500
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions lib/thumbnail.lib.php
Expand Up @@ -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);
$edt = true;

for($i=0; $i<count($matches[1]); $i++)
{
// 이미지 path 구함
$p = parse_url($matches[1][$i]);
if(strpos($p['path'], '/'.G5_DATA_DIR.'/') != 0)
$data_path = preg_replace('/^\/.*\/'.G5_DATA_DIR.'/', '/'.G5_DATA_DIR, $p['path']);
else
$data_path = $p['path'];
if(isset($matches[1]) && is_array($matches[1])){
for($i=0; $i<count($matches[1]); $i++)
{
// 이미지 path 구함
$p = parse_url($matches[1][$i]);
if(strpos($p['path'], '/'.G5_DATA_DIR.'/') != 0)
$data_path = preg_replace('/^\/.*\/'.G5_DATA_DIR.'/', '/'.G5_DATA_DIR, $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)) {
$size = @getimagesize($srcfile);
if(empty($size))
continue;
if(preg_match("/\.({$config['cf_image_extension']})$/i", $srcfile) && is_file($srcfile)) {
$size = @getimagesize($srcfile);
if(empty($size))
continue;

$filename = basename($srcfile);
$filepath = dirname($srcfile);
$filename = basename($srcfile);
$filepath = dirname($srcfile);

preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matches[0][$i], $malt);
$alt = get_text($malt[1]);
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matches[0][$i], $malt);
$alt = get_text($malt[1]);

break;
break;
}
}
}
}
Expand Down

0 comments on commit 3efa500

Please sign in to comment.