갤러리 소스에서 세로크기가 제어가 안되요

세로크기를 100으로 맞춰도.
무작정 커지네요.
 
파일첨부합니다.
 
 
주소입니다.
 

첨부파일

list.skin.php (10 KB) 4회 2006-12-31 05:10
|

댓글 3개

이미지 싸이즈 고정소스 재공해드릴게요.

아래거는 서로다른 이미지를 원본이미지를 최소로 훼손하지 않고 같은 크기로 resize image 화 합니다. ... 출처~ 불명~

<?php

$image = $_REQUEST['image'];
$max_width = $_REQUEST['max_width'];
$max_height = $_REQUEST['max_height'];

if (!$max_width)
$max_width = 80;
if (!$max_height)
$max_height = 60;

$size = GetImageSize($image);
$width = $size[0];
$height = $size[1];

$x_ratio = $max_width / $width;
$y_ratio = $max_height / $height;

if ( ($width <= $max_width) && ($height <= $max_height) ) {
$tn_width = $width;
$tn_height = $height;
}
else if (($x_ratio * $height) < $max_height) {
$tn_height = ceil($x_ratio * $height);
$tn_width = $max_width;
}
else {
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}

$src = ImageCreateFromJpeg($image);
$dst = ImageCreate($tn_width,$tn_height);
ImageCopyResized($dst, $src, 0, 0, 0, 0,
$tn_width,$tn_height,$width,$height);
header('Content-type: image/jpeg');
ImageJpeg($dst, null, -1);
ImageDestroy($src);
ImageDestroy($dst);

?>
사용방법....은 이미지 뿌려줄 곳에..아래처럼 하시면 돼요.

<?
// 이미지
echo "<a href='{$list[$i][href]}'>";
$image = urlencode($list[$i][file][0][file]);
if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
echo '<img src="../m_shop/image_size.php?image=';
echo "$g4[path]/data/file/$bo_table/$image";
echo '&max_width=120&max_height=200" border=0 align = left>';
echo "</a>";


}
else if (!file_exists($list[$i][file_image0])){
echo "no image file";
}
?>
근데요...제가 설치해보니 아무 문제 없는데요..
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
19년 전 조회 1,505
19년 전 조회 1,615
19년 전 조회 1,515
19년 전 조회 1,533
19년 전 조회 1,533
19년 전 조회 1,514
19년 전 조회 1,739
19년 전 조회 1,681
19년 전 조회 1,567
19년 전 조회 1,513
19년 전 조회 1,821
19년 전 조회 1,788
19년 전 조회 2,361
19년 전 조회 1,560
19년 전 조회 1,669
19년 전 조회 1,508
19년 전 조회 1,534
19년 전 조회 2,268
19년 전 조회 1,514
19년 전 조회 1,519
🐛 버그신고