get_list_thumbnail 썸네일이미지를 최상단으로 지정하려고 수정중인데 잘 먹히지가 않습니다.

get_list_thumbnail 썸네일이미지를 최상단으로 지정하려고 수정중인데 잘 먹히지가 않습니다.

QA

get_list_thumbnail 썸네일이미지를 최상단으로 지정하려고 수정중인데 잘 먹히지가 않습니다.

본문

이미지 썸네일이 세로형으로 길어서 상단부분으로 지정하려고 $crop_mode 를 top 기입하고 필요한부분을 수정하여 관리자 썸네일파일일괄삭제도 하였으나 잘 먹히지가 않습니다.

 

본이미지가 600x1200 정도로 길긴하지만 center일때와 top일때가 변화가 없어 소스를 잘못적용시켰나해서 봐도 틀린부분이 보이지가 않습니다.

 

빠진부분이 있는건지 도움 부탁드려요 ㅠ

 

 

/list.skin.php


$thumb_width = 280;
$thumb_height = 200;
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true,'top');

 

/lib/thumbnail.lib.php


function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='top', $is_sharpen=false, $um_value='80/0.5/3')
...
function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop=true, $crop_mode='top', $is_sharpen=false, $um_value='80/0.5/3')
...
        if($is_crop) {
            switch($crop_mode)
            {
                case 'top':
                    if($size[1] / $size[0] >= $ratio) {
                        $src_h = round($src_w * $ratio);
                        $src_y = round(($size[1] - $src_h) / 2);
                    } else {
                        $src_w = round($size[1] / $ratio);
                        $src_x = round(($size[0] - $src_w) / 2);
                    }
                    break;
                default:
                    if($size[1] / $size[0] >= $ratio) {
                        $src_h = round($src_w * $ratio);
                    } else {
                        $src_w = round($size[1] / $ratio);
                    }
                    break;
            }
            $dst = imagecreatetruecolor($dst_w, $dst_h);

 

 

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
전체 59,611
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT