이미지크기고정 질문입니다~~

config.php파일 36째줄에서
$cfg[large_image_size] = 500; // 이 수치가 넘어가면 이 수치로 게시판 이미지 크기 고정

여기에서 수치를 바꾸어도 아무런 변동이 없는데 이찌그런지

현재 그누 3.08로 업한 상태 입니다..

게시판 크기가 650 이여서 이보다 큰 이미지를  올리면 게시판 테이블이 깨지거든요

이렇게 해도 안되기에

gnuboard.lib.php 의
파일 제어 부분을 이렇게 고쳤습니다.

if (preg_match($cfg[image_extension], $file))
&nbsp; &nbsp; &nbsp; &nbsp;return "<img src='./data/file/$board[bo_table]/$file' &nbsp;width='630' height='410' border=0><p>";
&nbsp; &nbsp;else if (preg_match($cfg[flash_extension], $file))
&nbsp; &nbsp; &nbsp; &nbsp;return "<embed src='./data/file/$board[bo_table]/$file' width='630' height='410'></embed><p>";
&nbsp; &nbsp;else if (preg_match($cfg[movie_extension], $file))
&nbsp; &nbsp; &nbsp; &nbsp;return "<embed src='./data/file/$board[bo_table]/$file'></embed><p>";

}

그런데 문제는 &nbsp;이미지 크기가 비율이 원본하고 맞지않아 모양이 찌그러진다는 문제가 생기는군요 가로싸이즈가 줄어든 만큼 세로 싸이즈는 자동으로 변환이 되어야 할텐데 말입니다..

이미지 리싸이징하는 방법이 &nbsp;없나요?..
|

댓글 1개

이미지 찌그러지는 현상은 잡았습니다

// 파일을 보이게 하는 링크 (이미지, 플래쉬, 동영상)
function view_file_link($file)
{
global $cfg, $board;

if (!$file) return;

$size = @getimagesize("./data/file/$board[bo_table]/$file");
$source_width = $size[0];
$source_height = $size[1];

if ($board[bo_table_width] <=650) <---이부분 입니다 @@@##@#@@#>원본은 100으로 되어 있는데 아마도 100%를 의미하는가봅니다 이것을 실제 테이블의 크기로 넣어 주었더니 되는군요 아참 config.php에서 설정한 값이 넘어 오게됩니다..
{
if ($size[0] > $cfg[large_image_size]) {
$rate = $size[1] / $size[0];
$size[0] =$cfg[large_image_size];
$size[1] = (int)($size[0] * $rate);
}
} else {
if ($size[0] > $board[bo_table_width]) {
$rate = $size[1] / $size[0];
$size[0] = $board[bo_table_width];
$size[1] = (int)($size[1] * $rate);
}
}

$width = $size[0];
$height = $size[1];

if (preg_match($cfg[image_extension], $file))
return "<img src='./data/file/$board[bo_table]/$file' width='$width' height=' $height' border=0><p>";
else if (preg_match($cfg[flash_extension], $file))
return "<embed src='./data/file/$board[bo_table]/$file' width='$width' height=' $height'></embed><p>";
else if (preg_match($cfg[movie_extension], $file))
return "<embed src='./data/file/$board[bo_table]/$file'></embed><p>";

}
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3질답

+
제목 글쓴이 날짜 조회
네모똘
22년 전 조회 492
22년 전 조회 675
22년 전 조회 596
22년 전 조회 1,005
22년 전 조회 581
&&nbsp;&nbsp;
22년 전 조회 856
22년 전 조회 653
22년 전 조회 519
22년 전 조회 435
22년 전 조회 869
22년 전 조회 557
22년 전 조회 1,796
22년 전 조회 452
22년 전 조회 419
22년 전 조회 469
22년 전 조회 443
22년 전 조회 562
22년 전 조회 522
22년 전 조회 593
22년 전 조회 471
🐛 버그신고