첨부파일 crop

첨부파일 crop

QA

첨부파일 crop

본문

첨부파일 이미지로 10개가 있는데,

이 파일들을 crop해서 불러오려고 하는데, 

(view 페이지에서)

 

기존의 불러오는 소스인



<?php
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
    echo "<div id=\"bo_v_img\">\n";

    for ($i=0; $i<=count($view['file']); $i++) {
        if ($view['file'][$i]['view']) {
            //echo $view['file'][$i]['view'];
            echo get_view_thumbnail($view['file'][$i]['view']);
        }
    }
    echo "</div>\n";
}
?>

는 crop이 되지 않아서, 찾다가

 



// 게시글리스트 썸네일 생성
function multi_get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3', $option=0)
{
    global $g5, $config;
    $filename = $alt = "";
    $edt = false;

    $sql = " select bf_file, bf_content from {$g5['board_file_table']} 
                where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_type between '1' and '3' order by bf_no limit $option, 1 ";
    $row = sql_fetch($sql);
이하생략

이런식으로 정의해놓고,

 

현재 view페이지 에서 불러오는 소스를 



<?php
for($i=1;$i<=10;$i++){
${"thumb".$i} = multi_get_list_thumbnail($board['bo_table'], $view['wr_id'], 1200, 530, 'false', 'true', 'center', 'false', '80/0.5/3', $i-1);
}

if($thumb1['src']) $img_content = '<img src="'.$thumb1['src'].'" >'.PHP_EOL;
if($thumb2['src']) $img_content .= '<img src="'.$thumb2['src'].'" >'.PHP_EOL;
if($thumb3['src'])  $img_content .= '<img src="'.$thumb3['src'].'" >'.PHP_EOL;
if($thumb4['src'])  $img_content .= '<img src="'.$thumb4['src'].'" >'.PHP_EOL;
if($thumb5['src']) $img_content .= '<img src="'.$thumb5['src'].'" >'.PHP_EOL;
if($thumb6['src']) $img_content .= '<img src="'.$thumb6['src'].'" >'.PHP_EOL;
if($thumb7['src'])  $img_content .= '<img src="'.$thumb7['src'].'" >'.PHP_EOL;
if($thumb8['src'])  $img_content .= '<img src="'.$thumb8['src'].'" >'.PHP_EOL;
if($thumb9['src']) $img_content .= '<img src="'.$thumb9['src'].'" >'.PHP_EOL;
if($thumb10['src']) $img_content .= '<img src="'.$thumb10['src'].'" >'.PHP_EOL;
echo $img_content;
?>

이렇게 불러오고 있습니다.

 

그런데 문제는 

불러오는것도 잘 되는데,

페이지 로딩시간이 늘어나서 ㅠ

어떤식으로 이미지를 불러와야 빨리 불러 올까요?

 

 

board.php?bo_table=테이블명&wr_id=1

게시물이 나오기까지 로딩시간이 생각보다 많이 걸리네요 ㅠ

 

 

이 질문에 댓글 쓰기 :

답변 1

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

회원로그인

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