이미지 섬네일 적용시 엑박이 뜹니다. 정보
이미지 섬네일 적용시 엑박이 뜹니다.
본문
위 두 스킨을 적용시키는데 첫번째는 이미지가 출력되지 않고
두번째는 엑박으로 표시가 됩니다.
PHP가 5버전이라서 이미지 질을 9로 해봤는데 마찬가지구요.
두 스킨의 공통점이 라면
GD 2.0.1 이상 버전에서만 정상 실행됩니다. (imagecopyresampled 함수 가능)
이것인데
GD
GD Support | enabled |
GD Version | bundled (2.0.34 compatible) |
FreeType Support | enabled |
FreeType Linkage | with freetype |
FreeType Version | 2.2.1 |
GIF Read Support | enabled |
GIF Create Support | enabled |
JPG Support | enabled |
PNG Support | enabled |
WBMP Support | enabled |
XBM Support | enabled |
JIS-mapped Japanese Font Support |
enabled |
PHP속성에서는 지원을 합니다.
다른건 안건들고 단순히 적용만 했는데 이미지가 출력되지 않더군요.
댓글 전체

2번째 스킬은 해결되었습니다.
/data/file/ 에서 섬네일 폴더를 죄다 지우니 정상적으로 출력이 됩니다.
저 플래시는 왜 안나오는건지..
/data/file/ 에서 섬네일 폴더를 죄다 지우니 정상적으로 출력이 됩니다.
저 플래시는 왜 안나오는건지..
플래시 테스트를 하지는 않았습니다만 확자자 문제인듯 합니다.
플래시에서 gif는 출력이 안됩니다.
또한 jpge와 같은 형태로 출력을 하셔야할 듯합니다.
그러므로 썸네일 확자자를 확인해보세요.
플래시에서 gif는 출력이 안됩니다.
또한 jpge와 같은 형태로 출력을 하셔야할 듯합니다.
그러므로 썸네일 확자자를 확인해보세요.

그림 파일 올린건 모두 *jpg 확장자입니다.
/data/file/ 에서 복사한 섬네일 파일을 보니까 무 확장자에 크기도 33bit 더군요.
복사가 제대로 이뤄지지 않은게 아닐까 싶은데.. 소스가 잘못됬다면 다른분도 안나와야 할텐데 이건 뭐..ㅡ,.ㅡ;;
아래는 latest.skin 소스입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 153; //썸네일 가로길이
$img_height = 102; //썸네일 세로길이
$img_quality = 100; //퀼리티 100이하로 설정
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb105'; //썸네일 이미지 생성 디렉토리
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<script language="javascript" src="<?=$latest_skin_path?>/flash.js"></script>
<script language="javascript">print_flash("<?=$latest_skin_path?>/show_latest_utf.swf?latest_num=<?=count($list)?>&<? for ($i=0; $i<count($list); $i++) {
$img = "img".$i."=".$g4_path."/img/noimage.gif&";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
// 썸네일 이미지가 존재하지 않는다면
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// 업로드된 파일이 이미지라면
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($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);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
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.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "img".$i."=".$thumb."&";
$datetime = substr($list[$i][wr_datetime],0,10);
$datetime2 = $list[$i][wr_datetime];
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", $g4['server_time'] - ($row['bo_new'] * 3600))) $comment_new = "new";
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
$list[$i][datetime] = $datetime;
$list[$i][datetime2] = $datetime2;
$a_link="link".$i."=".$list[$i][href]."&wr_id".$i."=".$list[$i][wr_id]."&subject".$i."=".$list[$i]['subject']."&";
$comment_cnt="comment_cnt".$i."=".$list[$i]['comment_cnt']."&";
?><?=$img?><?=$a_link?>contents<?=$i?>=<?=conv_subject(strip_tags($list[$i][wr_content]), 25, "…");?>&date<?=$i?>=<?=$list[$i][datetime]?>&<? } ?>", "164", "203");</script>
/data/file/ 에서 복사한 섬네일 파일을 보니까 무 확장자에 크기도 33bit 더군요.
복사가 제대로 이뤄지지 않은게 아닐까 싶은데.. 소스가 잘못됬다면 다른분도 안나와야 할텐데 이건 뭐..ㅡ,.ㅡ;;
아래는 latest.skin 소스입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 153; //썸네일 가로길이
$img_height = 102; //썸네일 세로길이
$img_quality = 100; //퀼리티 100이하로 설정
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb105'; //썸네일 이미지 생성 디렉토리
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<script language="javascript" src="<?=$latest_skin_path?>/flash.js"></script>
<script language="javascript">print_flash("<?=$latest_skin_path?>/show_latest_utf.swf?latest_num=<?=count($list)?>&<? for ($i=0; $i<count($list); $i++) {
$img = "img".$i."=".$g4_path."/img/noimage.gif&";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
// 썸네일 이미지가 존재하지 않는다면
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// 업로드된 파일이 이미지라면
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($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);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
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.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "img".$i."=".$thumb."&";
$datetime = substr($list[$i][wr_datetime],0,10);
$datetime2 = $list[$i][wr_datetime];
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", $g4['server_time'] - ($row['bo_new'] * 3600))) $comment_new = "new";
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
$list[$i][datetime] = $datetime;
$list[$i][datetime2] = $datetime2;
$a_link="link".$i."=".$list[$i][href]."&wr_id".$i."=".$list[$i][wr_id]."&subject".$i."=".$list[$i]['subject']."&";
$comment_cnt="comment_cnt".$i."=".$list[$i]['comment_cnt']."&";
?><?=$img?><?=$a_link?>contents<?=$i?>=<?=conv_subject(strip_tags($list[$i][wr_content]), 25, "…");?>&date<?=$i?>=<?=$list[$i][datetime]?>&<? } ?>", "164", "203");</script>
갤러리 보드 썸네일 http://manya.aquz.biz/data/file/img_photo/thumb/29
갤러리 보드의 최신 게시물 썸네일 http://manya.aquz.biz/data/file/img_photo/thumb105/29
썸네일이 제대로 생성이 안되는 것 같습니다.
엑박으로 나오네요.
갤러리 보드의 최신 게시물 썸네일 http://manya.aquz.biz/data/file/img_photo/thumb105/29
썸네일이 제대로 생성이 안되는 것 같습니다.
엑박으로 나오네요.

소스를 고쳐야 하나요?
올려주신분은 제대로 작동하니까 올려주셨을 건데 ....
인터넷 환경 차이일까요?
올려주신분은 제대로 작동하니까 올려주셨을 건데 ....
인터넷 환경 차이일까요?
두가지 버젼 모두 테스트를 하여 보니 별 문제 없이 잘 작동합니다.
소스 수정을 하지 않으셨다면 다른 것에 영향을 받을 것같습니다.
기존 스킨과 게시판의 글을 다 지우고 ftp에서 해당 저장소도 다 지우고 처음부터 다시 해보심이...
아니면 썸네일 생성함수를 기존 보드에 있는 것으로 해보시는 것도 좋을 것 같습니다만...
ps : 글쓰기시 에러 나는 것에 대한 해결을 하셔야할 둣합니다.
이것과 관련이 있을 듯합니다.
글을 쓰면 에러 페이지가 출력되면서 업로드에 문제가 생기는 듯합니다.
글은 등재가 되긴합니다만... 그림파일에 문제가 있더군요.
그 사항에서 썸네일이 생성과 그림이 이상하게 나옵니다.
그런 상항에서 최신 게시물의 썸네일도 이상이 있는 그림에 대해 썸네일을 생성하기에 엑박으로 나오는 것이 아닌가 싶습니다.
업로드된 그림을 수정하여도 이미 생성한 썸네일을 지우지 않게 된다면 더 이상의 썸네일 생성을 하지 않게 되기에 플래시에서 안나오는 것이 아닌가 싶군요.
설명을 제대로 했는지 모르겠네요.
소스 수정을 하지 않으셨다면 다른 것에 영향을 받을 것같습니다.
기존 스킨과 게시판의 글을 다 지우고 ftp에서 해당 저장소도 다 지우고 처음부터 다시 해보심이...
아니면 썸네일 생성함수를 기존 보드에 있는 것으로 해보시는 것도 좋을 것 같습니다만...
ps : 글쓰기시 에러 나는 것에 대한 해결을 하셔야할 둣합니다.
이것과 관련이 있을 듯합니다.
글을 쓰면 에러 페이지가 출력되면서 업로드에 문제가 생기는 듯합니다.
글은 등재가 되긴합니다만... 그림파일에 문제가 있더군요.
그 사항에서 썸네일이 생성과 그림이 이상하게 나옵니다.
그런 상항에서 최신 게시물의 썸네일도 이상이 있는 그림에 대해 썸네일을 생성하기에 엑박으로 나오는 것이 아닌가 싶습니다.
업로드된 그림을 수정하여도 이미 생성한 썸네일을 지우지 않게 된다면 더 이상의 썸네일 생성을 하지 않게 되기에 플래시에서 안나오는 것이 아닌가 싶군요.
설명을 제대로 했는지 모르겠네요.