이미지 리사이징처리시 문제입니다. 정보
이미지 리사이징처리시 문제입니다.본문
업로드시 이미지를 줄여 업로드되도록 처리하려고
위의 팁을 적용시켜 보았는데
관리자메뉴 게시판설정에서 이미지 폭을 600으로하면 이상이 없는데
이미지 싸이즈를 550으로 설정했더니 이미지가 모자이크 처리한것 처럼
깨져서 출력됩니다.
이미지 변환에서 문제가 생긴것 같은데 유독 600이하의 싸이즈에서만
문제가 되는 이유가 무었일까요?
이걸 사용해야하는데 감이 잡히지가 않네요...
스킨에 관계없이 위의 코드를 write_update.skin.php 에 추가시키면
이런증상이 발생합니다.
댓글 전체

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$sql2=" select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc";
$results2 = sql_query($sql2);
for ($d=0; $row2=sql_fetch_array($results2); $d++) { //~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ($_FILES[bf_file][name][$d])
{
$file = $data_path .'/'. $row2[bf_file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $board[bo_image_width] / $size[0];
$height = (int)($size[1] * $rate);
if ($size[0] > $board[bo_image_width]){
@unlink($data_path.'/'.$row2[bf_file]);
$dst = imagecreatetruecolor($board[bo_image_width], $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_image_width], $height, $size[0], $size[1]);
imagejpeg($dst, $data_path.'/'.$row2[bf_file], $board[bo_2]);
chmod($data_path.'/'.$row2[bf_file], 0606);
$bf_size = @filesize(addslashes($file));
$sql = " update $g4[board_file_table]
set bf_filesize = '$bf_size'
where bo_table = '$bo_table' and wr_id = '$wr_id' ";
sql_query($sql);
}
}
}
}
$thumb_path = $data_path.'/thumb';
$sql2=" select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc";
$results2 = sql_query($sql2);
for ($d=0; $row2=sql_fetch_array($results2); $d++) { //~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ($_FILES[bf_file][name][$d])
{
$file = $data_path .'/'. $row2[bf_file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $board[bo_image_width] / $size[0];
$height = (int)($size[1] * $rate);
if ($size[0] > $board[bo_image_width]){
@unlink($data_path.'/'.$row2[bf_file]);
$dst = imagecreatetruecolor($board[bo_image_width], $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_image_width], $height, $size[0], $size[1]);
imagejpeg($dst, $data_path.'/'.$row2[bf_file], $board[bo_2]);
chmod($data_path.'/'.$row2[bf_file], 0606);
$bf_size = @filesize(addslashes($file));
$sql = " update $g4[board_file_table]
set bf_filesize = '$bf_size'
where bo_table = '$bo_table' and wr_id = '$wr_id' ";
sql_query($sql);
}
}
}
}

그런데.... 저는 550에 맞추어서 잘되는데요...bo_1 가로싸이즈 bo_2 해상도 저는 대략 70 혹은 80합니다. 그런데 잘됩니다.
해상도를 100에서 80으로 하나까 잘되는군요..
이상한 현상이네요...
연구대상 입니다.
감사합니다 열정님...
이상한 현상이네요...
연구대상 입니다.
감사합니다 열정님...
ms_g6... 이라는 스킨을 사용하는데, 저도 같은 증상이 생겨 테스트해보니 여분필드2와9 둘 다 값이 있어야 되네요.
그리고 실제로 퀄리티를 좌우하는 부분은 여분필드 9가 아니라 여분필드2더군요.
참고하세요.
그리고 실제로 퀄리티를 좌우하는 부분은 여분필드 9가 아니라 여분필드2더군요.
참고하세요.