썸네일 사이즈 조절 관련 질문..
안녕하세요.
제가 최신글 스킨을 하나 작업중인데요...
갤러리에 올라가 있는 파일 두개를 불러와서..
1번 파일을 배경으로 깔고..
2번 파일을 테이블 우측 하단에 조그만 사진으로 넣어주는 것입니다.
여기서 문제!
첫째. 1번 파일은 배경으로 들어가기 때문에..파일을 그냥 넣어주니까..
사이즈 조절이 안된채로 올라가게 되네요. 그래서 원하는 모양이 아니라..
이미지가 큰 경우 잘린채로 그냥 배경이 되네요..
두번째. 링크를 걸려니.. 배경에는 걸 수가 없어서 조그만 이미지에만 링크를 걸 수 밖에 없네요..
해결 방법이 없을까요??
역시나 포인트는 전재산 다 걸도록 하겠습니다.
-------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$cols = 8; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$imgwidth=105; //표시할 이미지의 가로사이즈
$imgheight=140; //표시할 이미지의 세로사이즈
$imgwidth_thum=51; //표시할 이미지의 가로사이즈
$imgheight_thum=68; //표시할 이미지의 세로사이즈
$image_h = 18; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
?>
//for문 시작
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign='top'>
<?
$image = $list[$i][file][0][file]; //원본
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
$img2 = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][1][file]);
echo "<table width='$imgwidth' height='$imgheight' background='$img' cellpadding='0' cellspacing='0' border='0' align='center'>";
echo "<tr><td valign='bottom' align='right'><a href='{$list[$i]['href']}'><img src='$img2' width='$imgwidth_thum' height='$imgheight_thum' style='width:{$imgwidth_thum}px;height:{$imgheight_thum}px;border:1px solid #111111;'></a></td></tr></table>";
?>
</td>
<? } ?>
제가 최신글 스킨을 하나 작업중인데요...
갤러리에 올라가 있는 파일 두개를 불러와서..
1번 파일을 배경으로 깔고..
2번 파일을 테이블 우측 하단에 조그만 사진으로 넣어주는 것입니다.
여기서 문제!
첫째. 1번 파일은 배경으로 들어가기 때문에..파일을 그냥 넣어주니까..
사이즈 조절이 안된채로 올라가게 되네요. 그래서 원하는 모양이 아니라..
이미지가 큰 경우 잘린채로 그냥 배경이 되네요..
두번째. 링크를 걸려니.. 배경에는 걸 수가 없어서 조그만 이미지에만 링크를 걸 수 밖에 없네요..
해결 방법이 없을까요??
역시나 포인트는 전재산 다 걸도록 하겠습니다.
-------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$cols = 8; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$imgwidth=105; //표시할 이미지의 가로사이즈
$imgheight=140; //표시할 이미지의 세로사이즈
$imgwidth_thum=51; //표시할 이미지의 가로사이즈
$imgheight_thum=68; //표시할 이미지의 세로사이즈
$image_h = 18; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
?>
//for문 시작
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign='top'>
<?
$image = $list[$i][file][0][file]; //원본
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
$img2 = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][1][file]);
echo "<table width='$imgwidth' height='$imgheight' background='$img' cellpadding='0' cellspacing='0' border='0' align='center'>";
echo "<tr><td valign='bottom' align='right'><a href='{$list[$i]['href']}'><img src='$img2' width='$imgwidth_thum' height='$imgheight_thum' style='width:{$imgwidth_thum}px;height:{$imgheight_thum}px;border:1px solid #111111;'></a></td></tr></table>";
?>
</td>
<? } ?>
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 7개
첨부 이미지 처럼 인물 일때는 알맞은 부위를 잘라서 썸네일을 만들어야 하는데 그게 쉬운방법이 아니지요
GD 사용법을 모른 다면 불가능한 일이겠구요
배경에도 링크가 걸리게 하는 것은 onmousedown을 사용하면 됩니다
그렇기에 맞는 부위를 자를 필요없이 사이즈만 줄이면 됩니다.
onmousedown 감사해요~
레이어1 레이어2로 하시면 사이즈는 조절 되지 않을까요? 링크도 걸리구요
가능하시면 좀 부탁드릴께요..^^
어째든 썸네일이 됬든 원본이 됬든 레이어를 이용하신다면
<td style="position:relative">
<div style="position:absolute; width:200px; height:200px; left: 0px; top: 0px; z-index:1; ">
<img src="배경이미지" width="200" height="200">
</div>
<div style="position:absolute; width:50px; height:50px; left: 150px; top: 150px; z-index:2; " >
<img src="작은이미지" width="50" height="50">
</div>
</td>
확인하고 점수 쏠께요..^^;;;