갤러리 리스트에서 gif로 나타내기질문 정보
갤러리 리스트에서 gif로 나타내기질문
본문
write_update.skin.php 에서요.
그림파일경로를 보면 /스킨명/thumb/21 인데요. gif로 움직이는 그림으로 나타내게하려는데
정지그림으로 고정되버립니다. 어떻게 바꾸어줘야할까요. 1시간넘게 헤매고있는데 답이 안나오네요^^;
리스트 확장명을 .gif로 강제적으로 나타나게해도 고정되버립니다.
제생각에는 파일업로드될때 gif 속성이 없어져버리는거같기도한데 삽질의 연속입니다.ㅠㅠ
고수님들의 도움을 부탁드리겠습니다.
write_update.skin.php
<? // ver 4.09.02
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
//print_r2($_FILES); exit;
$img_width = $board[bo_1];
$img_height = $board[bo_2];
$img_quality = $board[bo_3];
$img_height = $board[bo_2];
$img_quality = $board[bo_3];
if (!$board[bo_1])
$img_width = 150; // 이미지의 폭
if (!$board[bo_2])
$img_height = 150; // 이미지의 높이
if (!$board[bo_3])
$img_quality = 100; // 이미지의 질(quality)
$img_width = 150; // 이미지의 폭
if (!$board[bo_2])
$img_height = 150; // 이미지의 높이
if (!$board[bo_3])
$img_quality = 100; // 이미지의 질(quality)
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$thumb_path = $data_path.'/thumb';
if ($_FILES[bf_file][name][0])
{
$row = sql_fetch(" select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '0' ");
{
$row = sql_fetch(" select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '0' ");
$file = $data_path .'/'. $row[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;
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 = $img_width / $size[0];
$height = (int)($size[1] * $rate);
$height = (int)($size[1] * $rate);
@unlink($thumb_path.'/'.$wr_id);
// 계산된 높이가 설정된 높이보다 작다면
if ($height < $img_height)
$dst = imagecreatetruecolor($img_width, $height);
else
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$wr_id, $img_quality);
chmod($thumb_path.'/'.$wr_id, 0606);
}
}
?>
// 계산된 높이가 설정된 높이보다 작다면
if ($height < $img_height)
$dst = imagecreatetruecolor($img_width, $height);
else
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$wr_id, $img_quality);
chmod($thumb_path.'/'.$wr_id, 0606);
}
}
?>
댓글 전체