최신글 관련 스킨을 받아 적용시키기 위해 불당썸을 적용했습니다. 사실 사용법을 잘 몰라..그냥
해당 디렉토리에 불당썸 관련 파일을 복사한 후 스킨을 적용해 보았는데요...
문제는 세로폭은 스킨에서 설정한 대로 정상적으로 썸네일이 생성 되는데...해상도와 가로는 설정한 것과
전혀 다르게 나오네요. 예를 들어 5 x 96 이런식으로 생성이 되어 버려요.
과연 무엇이 문제일까요? 조언을 부탁 드립니다..
참고로 사진 해상도는 500 x 375랍니다. 불당썸은 최신 버전을 적용했습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$g4[path]/lib/thumb.lib.php");
/******설정**************/
if (!$board[bo_1]) $board[bo_1]=125; //목록 썸네일 가로
if (!$board[bo_2]) $board[bo_2]=96; //목록 썸네일 세로
if (!$board[bo_3]) $board[bo_3]=99; //해상도
/******설정**************/
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 최신글입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/_thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$mod = $board[bo_gallery_cols];
$td_width = (int)(99 / $mod);
$sql="select * from {$g4['board_file_table']} where bo_table='$bo_table' and bf_file !='' order by bf_datetime asc limit 1 ";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
$file=$data_path .'/'. $row[bf_file];
if($row[bf_file]){
$img="<a href='{$g4[bbs_path]}/board.php?bo_table={$bo_table}&wr_id={$row[wr_id]}'><img src='".thumbnail($file,$board[bo_1],$board[bo_2])."' border='0' style='border:1px solid #333333'></a>";
}else{
$img="<img src='".$latest_skin_path."/img/noimg.gif' border='0' style='border:1px solid #333333'>";
}
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td> <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
<td align=right><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a> </td>
</tr>
</table>
<table width=100% cellpadding=0 cellspacing=0>
<col width='20%' bgcolor=#143e77></col>
<col width='80%' bgcolor=#e1e1e1></col>
<tr height=1><td></td><td></td></tr>
</table>
<div style="height:10px"></div>
<div style="width:100%">
<div style="float:left;padding-right:10px">
<?=$img?>
</div>
<div style="float:right;">
<table width=100% cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=20>
<td> <font color=#143e77><b>·</b></font>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:tahoma; font-size:12px; color:#333333;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:tahoma; font-size:12px; color:#333333;'>{$list[$i]['subject']}</font>";
echo "</a>";
if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:tahoma; font-size:12px; color:#333333;'>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?></td>
<td align=right>
<font style='font-family:tahoma; font-size:12px; color:#2266c7;'><?echo $list[$i]['datetime'];?></font>
</td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
</div>
</div>
α տ ֽϴ.
⺻ crop ʱ ̹Ƿ, is_crop ʵ带 true ϸ ǰ?
// $file_name : ϸ
// $width :
// $height : ( ̸ )
// * $width, $height , ̹ ״ thumb
// $is_create : ̹ , θ
// $is_crop : ̰ $height crop
// 0 : crop ʽϴ
// 1 : ⺻ crop
// 2 : ߰ crop
// $quality : quality (jpeg, png شϸ, gif ش )
// $small_thumb : 1 (true)̸, ̹ /̺
// 2̸, ̹ /̺ Ȯ
// $watermark : ũ ¿
// $watermark[][filename] - ũ ϸ
// $watermark[location] - center, top, top_left, top_right, bottom, bottom_left, bottom_right
// $watermark[x],$watermark[y] - location offset
// $filter : php imagefilter, http://kr.php.net/imagefilter
// $filter[type], [arg1] ... [arg4]
// $noimg : $noimg(̹)
// $thumb_type : (jpg/gif/png. )
/*
function createThumb($imgWidth, $imgHeight, $imgSource, $imgThumb='', $is_crop=true, $iscut=false)
is_crop true ߴµ, ϸ dz?
.... մϴ. ۰ . 4.....
Լ θ ... thumbnail(ϸ, ,,0,1) ̷ ˴ϴ
ΰ ۴ٸ bo_1 .
Ų bo_1 ٸ ($imgWidth ) ٽ ϴ
.
մϴ...^^