png파일을 첨부하면 엑박이 뜹니다. 채택완료
둘째삼식
11년 전
조회 8,876
게시판에서 png파일(사진)을 첨부하면, 썸네일 최신글에서 사진이 안나오고 엑박이 됩니다.
jpg파일 같은건 문제가 없습니다.
엑박 경로를 보니..
http://jeongbo-partner.com/board/data/file/news/1915816669_Yjmv83QL_001ec949fb1b14a1b3fc01.png.thumb">http://jeongbo-partner.com/board/data/file/news/1915816669_Yjmv83QL_001ec949fb1b14a1b3fc01.png.thumb
이렇게 되어 있네요.
초보자라서 어디가 문제인지 모르겠습니다...고수님들 도와주십시오.....

아래는 최신글 스킨입니다.
latest.skin.php
if(defined('_GNUBOARD_') == false)
{
exit();
}
if(defined('_PLUGIN_') == false)
{
define('_PLUGIN_', true);
include_once($latest_skin_path . '/latest.lib.php');
echo "";
}
list($width, $height, $default) = explode(',', $options);
?>
|
latest.lib.php
function make_thumbnail($exist, $creat, $width, $height, $default = null)
{
global $g4;
if(file_exists($exist) == true && in_array(strtolower(array_pop(explode('.', $exist))), array('gif', 'jpg', 'jpeg', 'png')) == true)
{
if(file_exists($creat) == false)
{
list($img['width'], $img['height'], $img['type']) = getimagesize($exist);
switch($img['type'])
{
case '1' :
$src['image'] = imagecreatefromgif($exist);
$dst['image'] = imagecreate($width, $height);
break;
case '2' :
$src['image'] = imagecreatefromjpeg($exist);
$dst['image'] = imagecreatetruecolor($width, $height);
break;
case '3' :
$src['image'] = imagecreatefrompng($exist);
$dst['image'] = imagecreatetruecolor($width, $height);
break;
}
$dst['color'] = imagecolorallocate($dst['image'], 255, 255, 255);
imagefilledrectangle($dst['image'], 0, 0, $width, $height, $dst['color']);
imagecopyresampled($dst['image'], $src['image'], 0, 0, 0, 0, $width, $height, $img['width'], $img['height']);
switch($img['type'])
{
case '1' :
imagegif($dst['image'], $creat);
break;
case '2' :
imagejpeg($dst['image'], $creat, 130);
break;
case '3' :
imagepng($dst['image'], $creat, 100);
break;
}
imagedestroy($src['image']);
imagedestroy($dst['image']);
}
$return = "
";
}
else
{
$return = $default;
}
return $return;
}
?>
댓글을 작성하려면 로그인이 필요합니다.
답변 4개
채택된 답변
+20 포인트
11년 전
위 소스를 가져다가 실험을 해 봤는 데 소스를 정확하게 분석하기는
지루하고 해서 다음 처럼 그누보드5에 있는 썸라이브러리를 이용했더니
잘 됩니다. (원하시는건지는 모르겠지만...ㅎㅎ)
latest.lib.php파일을 사용하지 않고 그누보드5의 lib디렉토리에 있는 thumbnail.lib.php 파일을 사용.
다음 처럼 latest.skin.php을 바꿔 보세요.
if(defined('_GNUBOARD_') == false)
{
exit();
}
if(defined('_PLUGIN_') == false)
{
define('_PLUGIN_', true);
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
//include_once($latest_skin_path . '/latest.lib.php');
$imgwidth = 150; //표시할 이미지의 가로사이즈
$imgheight = 110; //표시할 이미지의 세로사이즈
echo "";
}
list($width, $height, $default) = explode(',', $options);
?>
div.img {border:2px solid #b9c695;}
div.img:hover {border:2px solid #ea6f0b;}
table.link a {color:#666666; }
table.link a:hover {color:#ea6f0b; text-decoration:underline;}
|
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $imgwidth, $imgheight);
if($thumb['src']) {
$img_content = '
} else {
$img_content = 'NO IMAGE';
}
echo $img_content;
?> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
이하 생략
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
둘째삼식
11년 전
댓글을 작성하려면 로그인이 필요합니다. 11년 전
latest.skin.php 파일에서 make_thumb() 함수를 호출하면서 $width, $height 값을 가지고 가야할것 같은데
위 소스만 봐서는 그렇지 못하는것 같습니다.
latest.skin.php 파일 상단에
$width = 130 ; //예를 들어 가로사이즈를 130이라 했을 때
$height = 100 ; 으로 설정을 한 후 다시 시도해 보세요.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
둘째삼식
11년 전
그렇게 아까 해봤는데도, 이미지 사이지는 변함이 없었습니다...ㅜㅜ
댓글을 작성하려면 로그인이 필요합니다. 답변에 대한 댓글 2개
c
cure
11년 전
음
�
둘째삼식
11년 전
어찌 방법이 없을까요?^^
댓글을 작성하려면 로그인이 필요합니다.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
둘째삼식
11년 전
썸네일이 원본 크기로 나오네요...ㅜㅜ
댓글을 작성하려면 로그인이 필요합니다. 답변을 작성하려면 로그인이 필요합니다. 로그인 |
echo $list[$i]['icon_reply'] . " ";?>

좀 더 연구를 해봐야 겠습니다.....ㅎㅎ