세로 이미지..추출시 넓이를 비율에 맞게...줄일려면..

세로 이미지..추출시 넓이를 비율에 맞게...줄일려면..

QA

세로 이미지..추출시 넓이를 비율에 맞게...줄일려면..

본문

http://ktcpg.com/bbs/bbs/main.php

 

메인 페이지에서 사진을 돌리고 있는데

가로로 된 사진은 문제가 안되는데 새로된 이미지가

비율이 많지 않아서 섬네일이 이상하게 보이네요.

 

세로 이미지가 올라오면 그 비율에 맞게 줄여서 작게 전체가 보이게 할려면

어찌 해야 하나요?

 

최근글 소스가..

 

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/thumb.lib.php");

$full_width = 710;
$thumb_width = 300; //큰 썸네일 가로
$thumb_height = 180; //큰 썸네일 세로

$quality= 100; //썸네일 퀄리티
$filter[type] = 99;
$filter[arg1] = 100;
$filter[arg2] = 1;
$filter[arg3] = 2;
?>
<script type="text/javascript" src="<?=$latest_skin_path?>/js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="<?=$latest_skin_path?>/js/jquery.rolling.js"></script>

<script type="text/javascript">
    $(document).ready(function () {

        $('#rolling').boutique({
            starter: 1,    //시작이미지설정 (1=첫번째 이미지)
            speed: 800,  //회전 빠르기 (숫자가 작을수록 빨라집니다.)
            container_width: <?=$full_width?>,  //#rolling 콘테이터 가로 크기(박스크기에 따라 유동적으로 좌우 이미지가 보였다 안보였다 합니다.)
            front_img_width: <?=$thumb_width?>,  //이미지 가로 크기
            front_img_height: <?=$thumb_height?>,  //이미지 세로 크기

            behind_opac: 0.9,  //두번째 사이드 이미지 불투명도
            back_opac: 0.4,  //맨 뒷쪽 이미지 불투명도
            behind_size: 0.8,  //두번째 사이드 이미지 축소 정도
            back_size: 0.6,  //맨 뒷쪽 이미지 축소 정도

            autoplay: true,  //자동재생
            autointerval: 3000,  //자동재생 대기 시간

            freescroll: true, // 마우스 휠 감지

            /*애니메이션 효과 설정(자세한 효과 방법은 http://gsgd.co.uk/sandbox/jquery/easing/ example을 참고하세요. */
            easing: 'easeOutQuart',
            move_twice_easein: 'easeInQuart',
            move_twice_easeout: 'easeOutQuart',

            text_front_only: true  //텍스트를 돌출된 이미지에만 나타나게(true) false로 설정하면 뒷쪽 이미지에도 다 나타납니다.
        });

    });
</script>
<link rel='stylesheet' href='<?=$latest_skin_path?>/scroll.css' type='text/css'>

 <!-- 슬라이드 -->
<div class="slide">
 <ul id="rolling">
 <?
 for ($i=0; $i<count($list); $i++) {
 if($list[$i][file][0][view]) {
  $src = $list[$i][file][0][path]."/".$list[$i][file][0][file];
  $thumb = thumbnail($src, $thumb_width, $thumb_height, 0, 1, $quality, 0, "",  $filter, $noimg); // 0 그대로 2 확대
 }  else { // data/cheditor------
  $edit_img = $list[$i]['wr_content'];
  if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) {
  $file = $g4[path].'/' . $tmp[0]; // 파일명
  $thumb = thumbnail($file, $thumb_width, $thumb_height, 0, 1, $quality, 0, "",  $filter, $noimg); // 0 그대로 2 확대
  }
 }
 ?>
  <li><a href="<?=$list[$i]['href']?>" ><img src="<?=$thumb?>" alt="<?=$list[$i]['subject']?>" /></a></li>
 <? } ?>
 </ul>
 
  <!-- 하단 버튼-->
  <!-- <div id="controlbtn">
   <img src="<?=$latest_skin_path?>/img/btn_rolling_control_left.gif" onclick="rolling_ext_prev()" style="cursor:pointer;" />
   <img src="<?=$latest_skin_path?>/img/btn_rolling_control_right.gif" onclick="rolling_ext_next()" style="cursor:pointer;" />
  </div>  -->
  <!-- //하단 버튼 -->
</div>
 <!-- //슬라이드 -->


이 질문에 댓글 쓰기 :

답변 1

​$thumb = thumbnail($src, $thumb_width, $thumb_height, 0, 1, $quality, 0, "",  $filter, $noimg);

$thumb = thumbnail($src, $thumb_width, $thumb_height, 0, 0, $quality, 0, "",  $filter, $noimg);

으로 변경해보세요. 크롭여부체크하는 부분입니다. 

감사합니다.
비율없이 줄어들게 되니 깨지는 현상이 발생하네요.

혹시 세로로 길이가 길면 중간 20%만 썸네일을 설정되게 할려면 어찌 해야 하나요?

아니면
가로은 정해져 있는 것으로 나오고
세로는 원본 크기로 해서 20% 크기로 해서 썸네일 생성을 하게 하고 싶은데...

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

회원로그인

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