게시판 리스트 목록 썸네일 추출시 gif 움직이게 정보
게시판 리스트 목록 썸네일 추출시 gif 움직이게본문
<?
for ($i=0; $i<count($list); $i++) {
$subject = "<span class='txt_subject'>".$list[$i][subject]."</span>";
$list[$i][preview] = strip_tags($list[$i][wr_content]);
$list[$i][preview] = nl2br($list[$i][preview]);
$list[$i][preview] = preg_replace("/\s*<br\s?\/?>\s*/i", " ", $list[$i][preview]);
$list[$i][preview] = str_replace("\"", "", $list[$i][preview]);
$list[$i][preview] = str_replace(" ", "", $list[$i][preview]);
$list[$i][preview] = str_replace(">", "", $list[$i][preview]);
$list[$i][preview] = conv_subject($list[$i][preview], 100, "...");
if(!$list[$i][preview]) $list[$i][preview] = "내용없음";
$content_img_array = "";
$content_img_array = hd_get_content_img($list[$i][wr_content]);
$thumb = array();
$original = array();
$image_file = "";
// 파일첨부 이미지 썸네일
if (is_array($list[$i]['file'])) {
foreach($list[$i]['file'] as $k => $v){
if($list[$i][file][$k][view]){
$temp_thumb = $thumb_path."/". $v['file']; // 썸네일 경로와 파일명
$image_file = $data_path . '/' . $v['file']; // 원본 경로와 파일명
$original[] = $data_path . '/' . $v['file']; // 원본 경로와 파일명
if(!file_exists($thumb_path."/". $v['file'])){
if(make_thumnail($image_file, $temp_thumb, $thumb_w, $thumb_h)) // 썸네일만 생성
$thumb[] = $thumb_path."/". $v['file']; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}else{
$thumb[] = $thumb_path."/". $v['file']; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}
}
}
}
if(!$image_file){
// 에디터 이미지 썸네일
foreach($content_img_array as $k => $v){
$Imgfilename = hd_get_imgname($v);
$temp_thumb = $thumb_path."/". $Imgfilename[1]; // 썸네일 경로와 파일명
$v = trim($v);
$image_file = (preg_match("`^(/|http)`i", $v)) ? str_replace(dirname(__FILE__), '', $_SERVER['DOCUMENT_ROOT'] . preg_replace("`https?://[^/]+`i", '', $v)) : $v;
if(!file_exists($thumb_path."/". $Imgfilename[1])){
if(make_thumnail($image_file, $temp_thumb, $thumb_w, $thumb_h)) // 썸네일만 생성
$thumb[] = $thumb_path."/". $Imgfilename[1]; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}else{
$thumb[] = $thumb_path."/". $Imgfilename[1]; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}
// 확대보기 이미지 다시선언
$image_file = $v;
$original[] = $v;
}
}
if(!$thumb[0]) $thumb[0] = $board_skin_path."/img/no_img_masonry.jpg";
if ($list[$i][is_notice]) { // 공지사항
$tipsy = " class=\"service-tipsy\" title=\"공지사항\"";
} else if ($list[$i][wr_blind] == 1) {
$tipsy = " class=\"service-tipsy\" title=\"차단된 글입니다\"";
$list[$i][preview] = "신고로 인해 차단된 게시물입니다.";
$thumb[0] = $board_skin_path."/img/blind_masonry.jpg";
} else {
$tipsy = "";
if (!strstr($list[$i][wr_option], "secret") || $is_admin || ($list[$i][mb_id]==$member[mb_id] && $member[mb_id])) {
} else {
$tipsy = " class=\"service-tipsy\" title=\"비밀글입니다\"";
$list[$i][preview] = "비밀글 입니다.";
$thumb[0] = $board_skin_path."/img/secret_masonry.jpg";
}
}
$notice = "";
if ($list[$i][is_notice]) $notice = "<div class='ribbon'><span class='notice'></span></div>";
$hot = "";
if ($list[$i][icon_hot]) $hot = "<div class='ribbon'><span class='hot'></span></div>";
$new_icon = "";
if ($list[$i][icon_new]) $new_icon = "<div class='ribbon'><span class='new'></span></div>";
$comment_cnt = "";
if ($list[$i][comment_cnt])
$comment_cnt = " <a class='txt_comment' href=\"{$list[$i][comment_href]}\"><span style='font-family:Tahoma;font-size:10px;color:#FF4326;'><strong>{$list[$i][comment_cnt]}</strong></span></a>";
?>
짤방 게시판인데 리스트에서도 gif가 움직이도록 하고싶습니다.
for ($i=0; $i<count($list); $i++) {
$subject = "<span class='txt_subject'>".$list[$i][subject]."</span>";
$list[$i][preview] = strip_tags($list[$i][wr_content]);
$list[$i][preview] = nl2br($list[$i][preview]);
$list[$i][preview] = preg_replace("/\s*<br\s?\/?>\s*/i", " ", $list[$i][preview]);
$list[$i][preview] = str_replace("\"", "", $list[$i][preview]);
$list[$i][preview] = str_replace(" ", "", $list[$i][preview]);
$list[$i][preview] = str_replace(">", "", $list[$i][preview]);
$list[$i][preview] = conv_subject($list[$i][preview], 100, "...");
if(!$list[$i][preview]) $list[$i][preview] = "내용없음";
$content_img_array = "";
$content_img_array = hd_get_content_img($list[$i][wr_content]);
$thumb = array();
$original = array();
$image_file = "";
// 파일첨부 이미지 썸네일
if (is_array($list[$i]['file'])) {
foreach($list[$i]['file'] as $k => $v){
if($list[$i][file][$k][view]){
$temp_thumb = $thumb_path."/". $v['file']; // 썸네일 경로와 파일명
$image_file = $data_path . '/' . $v['file']; // 원본 경로와 파일명
$original[] = $data_path . '/' . $v['file']; // 원본 경로와 파일명
if(!file_exists($thumb_path."/". $v['file'])){
if(make_thumnail($image_file, $temp_thumb, $thumb_w, $thumb_h)) // 썸네일만 생성
$thumb[] = $thumb_path."/". $v['file']; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}else{
$thumb[] = $thumb_path."/". $v['file']; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}
}
}
}
if(!$image_file){
// 에디터 이미지 썸네일
foreach($content_img_array as $k => $v){
$Imgfilename = hd_get_imgname($v);
$temp_thumb = $thumb_path."/". $Imgfilename[1]; // 썸네일 경로와 파일명
$v = trim($v);
$image_file = (preg_match("`^(/|http)`i", $v)) ? str_replace(dirname(__FILE__), '', $_SERVER['DOCUMENT_ROOT'] . preg_replace("`https?://[^/]+`i", '', $v)) : $v;
if(!file_exists($thumb_path."/". $Imgfilename[1])){
if(make_thumnail($image_file, $temp_thumb, $thumb_w, $thumb_h)) // 썸네일만 생성
$thumb[] = $thumb_path."/". $Imgfilename[1]; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}else{
$thumb[] = $thumb_path."/". $Imgfilename[1]; // 썸네일이 생성되면 배열에 썸네일 경로를 넣음
}
// 확대보기 이미지 다시선언
$image_file = $v;
$original[] = $v;
}
}
if(!$thumb[0]) $thumb[0] = $board_skin_path."/img/no_img_masonry.jpg";
if ($list[$i][is_notice]) { // 공지사항
$tipsy = " class=\"service-tipsy\" title=\"공지사항\"";
} else if ($list[$i][wr_blind] == 1) {
$tipsy = " class=\"service-tipsy\" title=\"차단된 글입니다\"";
$list[$i][preview] = "신고로 인해 차단된 게시물입니다.";
$thumb[0] = $board_skin_path."/img/blind_masonry.jpg";
} else {
$tipsy = "";
if (!strstr($list[$i][wr_option], "secret") || $is_admin || ($list[$i][mb_id]==$member[mb_id] && $member[mb_id])) {
} else {
$tipsy = " class=\"service-tipsy\" title=\"비밀글입니다\"";
$list[$i][preview] = "비밀글 입니다.";
$thumb[0] = $board_skin_path."/img/secret_masonry.jpg";
}
}
$notice = "";
if ($list[$i][is_notice]) $notice = "<div class='ribbon'><span class='notice'></span></div>";
$hot = "";
if ($list[$i][icon_hot]) $hot = "<div class='ribbon'><span class='hot'></span></div>";
$new_icon = "";
if ($list[$i][icon_new]) $new_icon = "<div class='ribbon'><span class='new'></span></div>";
$comment_cnt = "";
if ($list[$i][comment_cnt])
$comment_cnt = " <a class='txt_comment' href=\"{$list[$i][comment_href]}\"><span style='font-family:Tahoma;font-size:10px;color:#FF4326;'><strong>{$list[$i][comment_cnt]}</strong></span></a>";
?>
짤방 게시판인데 리스트에서도 gif가 움직이도록 하고싶습니다.
댓글 전체
움직이게 하고 싶다는건 슬라이드 말하는건가요?
아닙니다 ㅎ gif 이미지인데 움짤입니다
설명이 부족해 죄송합니다..
설명이 부족해 죄송합니다..
움직이게 하다는 말이 업로드한 gif가 애니메이션일 때 썸네일도 그렇게 만들고 싶다라는 말 같군요
일반적인 썸네일 만드는 방법으로는 아마도 불가능 하지않을까 싶습니다
일반적인 썸네일 만드는 방법으로는 아마도 불가능 하지않을까 싶습니다
균이님께서 안된다면 안되는거긴 한데... 제이쿼리를 이용하여 불당썸을 쓴다면 가능하지 않을까요?
http://jjals.com/ 이런 형태를 구현중입니다.
http://jjals.com/ 이런 형태를 구현중입니다.
얼쿠 댓글이 안된다면 안되는거군요 라고 잘못 -ㅂ-;;
어쨋든 사진을 저용량으로 줄이게 되면 파일 원본에 손상이 있어서 gif의 움직임 이미지에 문제가 오지 않을까요. 없는 경우라면, 그냥 첨부파일을 불러오는것도 하나의 방법인것 같습니다.
첨부파일로 불러온다면 로딩딜레이가 길어지고 용량으로 인해 출력 딜레이마저 커져서 문제가 되더라구요.
아, 제말은 불가능 하다는 말은 아닙니다
imagemagic 이라는 라이브러리가 있는데 이것은 서버에 설치 가능해야 하니 웹호스팅에서는
사용할 수가 없습니다
GD 라이브러리로도 가능은 한데 불당썸이나 갤러리 스킨에서 썸네일 생성에 사용하는 방법으로는
되는 것이 아마도 없을 것이라는 말입니다
gifencode, gifdecode 등으로 구글링 해보면 아마도 나올 것입니다
예전에 해본 바로는 ani gif인지 아닌지 체크해서 프레임별로 나누고
리사이징해서 합치고 그런 기능이었는데
사용하지않는 기능이다 보니...
저도 이참에 구글링 좀 해봐야겠네요
imagemagic 이라는 라이브러리가 있는데 이것은 서버에 설치 가능해야 하니 웹호스팅에서는
사용할 수가 없습니다
GD 라이브러리로도 가능은 한데 불당썸이나 갤러리 스킨에서 썸네일 생성에 사용하는 방법으로는
되는 것이 아마도 없을 것이라는 말입니다
gifencode, gifdecode 등으로 구글링 해보면 아마도 나올 것입니다
예전에 해본 바로는 ani gif인지 아닌지 체크해서 프레임별로 나누고
리사이징해서 합치고 그런 기능이었는데
사용하지않는 기능이다 보니...
저도 이참에 구글링 좀 해봐야겠네요