이미지 사이즈를 나타낼 수 있어요? 정보
이미지 사이즈를 나타낼 수 있어요?
본문
그누보드 질문은 아니라서 여기에 올립니다.
사진갤러리 스킨을 만들고 있거든요...
그런데, 썸네일 이미지 아래에 실제 이미지의 크기를 표시하려면 어떻게 해야하죠?
아래 검색화면 캡처처럼 구글에선 이미지 검색하면 사이즈까지 다 나오던데.....
그누보드에 혹시 기본 방법이 있나요? (찾질 못해서... ^^;;)
추천
1
1
댓글 6개

밸꺼아님 exif

긍까 그 별거 아닌 exif를 어떻게 다냔 말인데...
옵션님 약올릴려구 그런 댓글 다시는거죠? ㅋ
옵션님 약올릴려구 그런 댓글 다시는거죠? ㅋ

죄송 제가사용하는 view내용입니다. 덮어씌워서 디자인하시고 쓰세요
lightbox연동이라 그부분은 파일이 필요해서 지웠습니다.
썸네일만 만들어쓰심될꺼에요
그리고 서버에 exif가 설치되어 있어야 되는데 앤간하면 되있을꺼에요
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$exif = @exif_read_data("{$view[file][0][path]}/{$view[file][0][file]}");
?>
<script language=javascript>
//
// Configuration
//
var fileLoadingImage = "<?=$board_skin_path?>/images/loading.gif";
var fileBottomNavCloseImage = "<?=$board_skin_path?>/images/closelabel.gif";
var overlayOpacity = 0.8; // controls transparency of shadow overlay
var animate = true; // toggles resizing animations
var resizeSpeed = 10; // controls the speed of the image resizing animations (1=slowest and 10=fastest)
var borderSize = 10; //if you adjust the padding in the CSS, you will need to update this variable
</script>
<div id="ToolTip"></div>
<style>
<!--
#ToolTip{position:absolute;top:0;left:0;}
.ToolTip{table-layout:fixed;border-collapse:collapse;}
.ToolTip td{padding:1px;width:240px;height:180px;}
//-->
</style>
<style>
.main table {width:<?=$width?>;}
</style>
<div style="height:12px; line-height:1px; font-size:1px;"> </div>
<!-- 게시글 보기 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>
<div style="border:1px solid #ddd; clear:both; height:34px; background:url(<?=$board_skin_path?>/img/title_bg.gif) repeat-x;">
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td style="padding:8px 0 0 10px;">
<div style="color:#505050; font-size:13px; font-weight:bold; word-break:break-all;">
<? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?>
<?=cut_hangul_last(get_text($view[wr_subject]))?>
<?=$bo_table?>
</div>
</td>
<td align="right" style="padding:6px 6px 0 0;" width=400>
<span style="color:#888888;">등록일 : <?=date("y-m-d H:i", strtotime($view[wr_datetime]))?></span>
관리자 :<?=$view[name]?>
</td>
</tr>
</table>
</div>
<div style="height:3px; background:url(<?=$board_skin_path?>/img/title_shadow.gif) repeat-x; line-height:1px; font-size:1px;"></div>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td height=30 background="<?=$board_skin_path?>/img/view_dot.gif" style="color:#888;"><div style="float:left; margin-top:6px;"><img src="<?=$board_skin_path?>/img/icon_date.gif" align=absmiddle>
<span id="writeContents"><?=$view[content];?></span>
</div>
<div style="float:right;">
<?
ob_start();
?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_list_search.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_modify.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</div></td>
</tr>
<table width=100% bgcolor=F1F4F7>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++)
{
//if ($view[file][$i][source] && !$view[file][$i][view])
if ($view[file][$i][source])
{
$cnt++;
$exif = @exif_read_data("{$view[file][$i][path]}/{$view[file][$i][file]}");
$image = urlencode($view[file][$i][file]); // 파일이 이미지라면
echo "<tr>";
echo "<td width=45 rowspan=2><a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" onmousemove=\"msgposit();\" onmouseout=\"msghide();\" onmouseover=\"msgset('<img src=\'$g4[path]/data/file/$bo_table/$image\' width=300>";
echo "','');\"><img src='$g4[path]/data/file/$bo_table/$image' class=imgbox border='0'></a></td>";
echo "<td><a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><u><b>{$view[file][$i][source]}</b></u></a>";
if ($view[file][$i][content]) // 파일설명을 입력했을경우
echo" <font color=#FF8000>".$view[file][$i][content]."</font></td>";
echo "<td width=70> <a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><u>({$view[file][$i][size]})</u></a></td>";
echo "<td width=100><a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><u>(<b>{$exif[COMPUTED][Width]} x {$exif[COMPUTED][Height]}</b>)</u></a></td>";
echo "<td width=120><a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><u>{$exif[DateTimeOriginal]}</u></a></td>";
echo "</tr><tr><td colspan=5 bgcolor=E6EDF3>";
if (isset($exif[Make]) || isset($exif[Model])) echo "<span style=color:#888888;>카메라모델:$exif[Make] - $exif[Model]</span>";
if (isset($exif[COMPUTED][ApertureFNumber])) echo " <span style=color:#888888;>조리개:{$exif[COMPUTED][ApertureFNumber]}</span>";
if (isset($exif[ISOSpeedRatings])) echo " <span style=color:#888888;>ISO : $exif[ISOSpeedRatings]</span>";
if (isset($exif[WhiteBalance])) echo " <span style=color:#888888;>화이트밸런스:{$exif[WhiteBalance]}</span>";
if (isset($exif[ExposureTime])) echo " <span style=color:#888888;>노출:$exif[ExposureTime] 초</span>";
if (isset($exif[ExposureBiasValue])) echo " <span style=color:#888888;>보정:$exif[ExposureBiasValue]</span>";
if (isset($exif[COMPUTED][CCDWidth])) echo " <span style=color:#888888;>CCD:{$exif[COMPUTED][CCDWidth]}</span>";
if (isset($exif[Flash])) echo " <span style=color:#888888;>플래쉬:{$exif[Flash]}</span>";
echo "</td>";
echo "</tr><tr><td colspan=5 height=1 bgcolor=#ffffff>";
echo "</td></tr>";
}
}
// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++)
{
if ($view[link][$i])
{
$cnt++;
$link = cut_str($view[link][$i], 70);
echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_link.gif' align=absmiddle> <a href='{$view[link_href][$i]}' target=_blank><strong>{$link}</strong> ({$view[link_hit][$i]})</a></td></tr>";
}
}
?>
</table>
<tr><td height=1 bgcolor=#E7E7E7></td></tr>
</table>
<?
// 코멘트 입출력
include_once("./view_comment.php");
?>
<?=$link_buttons?>
<br>
<script language="JavaScript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href=link;
}
</script>
<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"></script>
<script language="JavaScript">
window.onload=function() {
resizeBoardImage(<?=(int)$board[bo_image_width]?>);
drawFont();
}
</script>
<!-- 게시글 보기 끝 -->
lightbox연동이라 그부분은 파일이 필요해서 지웠습니다.
썸네일만 만들어쓰심될꺼에요
그리고 서버에 exif가 설치되어 있어야 되는데 앤간하면 되있을꺼에요
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$exif = @exif_read_data("{$view[file][0][path]}/{$view[file][0][file]}");
?>
<script language=javascript>
//
// Configuration
//
var fileLoadingImage = "<?=$board_skin_path?>/images/loading.gif";
var fileBottomNavCloseImage = "<?=$board_skin_path?>/images/closelabel.gif";
var overlayOpacity = 0.8; // controls transparency of shadow overlay
var animate = true; // toggles resizing animations
var resizeSpeed = 10; // controls the speed of the image resizing animations (1=slowest and 10=fastest)
var borderSize = 10; //if you adjust the padding in the CSS, you will need to update this variable
</script>
<div id="ToolTip"></div>
<style>
<!--
#ToolTip{position:absolute;top:0;left:0;}
.ToolTip{table-layout:fixed;border-collapse:collapse;}
.ToolTip td{padding:1px;width:240px;height:180px;}
//-->
</style>
<style>
.main table {width:<?=$width?>;}
</style>
<div style="height:12px; line-height:1px; font-size:1px;"> </div>
<!-- 게시글 보기 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>
<div style="border:1px solid #ddd; clear:both; height:34px; background:url(<?=$board_skin_path?>/img/title_bg.gif) repeat-x;">
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td style="padding:8px 0 0 10px;">
<div style="color:#505050; font-size:13px; font-weight:bold; word-break:break-all;">
<? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?>
<?=cut_hangul_last(get_text($view[wr_subject]))?>
<?=$bo_table?>
</div>
</td>
<td align="right" style="padding:6px 6px 0 0;" width=400>
<span style="color:#888888;">등록일 : <?=date("y-m-d H:i", strtotime($view[wr_datetime]))?></span>
관리자 :<?=$view[name]?>
</td>
</tr>
</table>
</div>
<div style="height:3px; background:url(<?=$board_skin_path?>/img/title_shadow.gif) repeat-x; line-height:1px; font-size:1px;"></div>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td height=30 background="<?=$board_skin_path?>/img/view_dot.gif" style="color:#888;"><div style="float:left; margin-top:6px;"><img src="<?=$board_skin_path?>/img/icon_date.gif" align=absmiddle>
<span id="writeContents"><?=$view[content];?></span>
</div>
<div style="float:right;">
<?
ob_start();
?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_list_search.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_modify.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</div></td>
</tr>
<table width=100% bgcolor=F1F4F7>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++)
{
//if ($view[file][$i][source] && !$view[file][$i][view])
if ($view[file][$i][source])
{
$cnt++;
$exif = @exif_read_data("{$view[file][$i][path]}/{$view[file][$i][file]}");
$image = urlencode($view[file][$i][file]); // 파일이 이미지라면
echo "<tr>";
echo "<td width=45 rowspan=2><a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" onmousemove=\"msgposit();\" onmouseout=\"msghide();\" onmouseover=\"msgset('<img src=\'$g4[path]/data/file/$bo_table/$image\' width=300>";
echo "','');\"><img src='$g4[path]/data/file/$bo_table/$image' class=imgbox border='0'></a></td>";
echo "<td><a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><u><b>{$view[file][$i][source]}</b></u></a>";
if ($view[file][$i][content]) // 파일설명을 입력했을경우
echo" <font color=#FF8000>".$view[file][$i][content]."</font></td>";
echo "<td width=70> <a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><u>({$view[file][$i][size]})</u></a></td>";
echo "<td width=100><a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><u>(<b>{$exif[COMPUTED][Width]} x {$exif[COMPUTED][Height]}</b>)</u></a></td>";
echo "<td width=120><a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><u>{$exif[DateTimeOriginal]}</u></a></td>";
echo "</tr><tr><td colspan=5 bgcolor=E6EDF3>";
if (isset($exif[Make]) || isset($exif[Model])) echo "<span style=color:#888888;>카메라모델:$exif[Make] - $exif[Model]</span>";
if (isset($exif[COMPUTED][ApertureFNumber])) echo " <span style=color:#888888;>조리개:{$exif[COMPUTED][ApertureFNumber]}</span>";
if (isset($exif[ISOSpeedRatings])) echo " <span style=color:#888888;>ISO : $exif[ISOSpeedRatings]</span>";
if (isset($exif[WhiteBalance])) echo " <span style=color:#888888;>화이트밸런스:{$exif[WhiteBalance]}</span>";
if (isset($exif[ExposureTime])) echo " <span style=color:#888888;>노출:$exif[ExposureTime] 초</span>";
if (isset($exif[ExposureBiasValue])) echo " <span style=color:#888888;>보정:$exif[ExposureBiasValue]</span>";
if (isset($exif[COMPUTED][CCDWidth])) echo " <span style=color:#888888;>CCD:{$exif[COMPUTED][CCDWidth]}</span>";
if (isset($exif[Flash])) echo " <span style=color:#888888;>플래쉬:{$exif[Flash]}</span>";
echo "</td>";
echo "</tr><tr><td colspan=5 height=1 bgcolor=#ffffff>";
echo "</td></tr>";
}
}
// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++)
{
if ($view[link][$i])
{
$cnt++;
$link = cut_str($view[link][$i], 70);
echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_link.gif' align=absmiddle> <a href='{$view[link_href][$i]}' target=_blank><strong>{$link}</strong> ({$view[link_hit][$i]})</a></td></tr>";
}
}
?>
</table>
<tr><td height=1 bgcolor=#E7E7E7></td></tr>
</table>
<?
// 코멘트 입출력
include_once("./view_comment.php");
?>
<?=$link_buttons?>
<br>
<script language="JavaScript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href=link;
}
</script>
<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"></script>
<script language="JavaScript">
window.onload=function() {
resizeBoardImage(<?=(int)$board[bo_image_width]?>);
drawFont();
}
</script>
<!-- 게시글 보기 끝 -->

크기 2912 x 4368
카메라모델:Canon - Canon EOS 5D
조리개:f/16.0
ISO : 400
화이트밸런스:0
노출:1/200 초
보정:0/1
CCD:23mm
플래쉬:16
이렇게 나옵니다.
카메라모델:Canon - Canon EOS 5D
조리개:f/16.0
ISO : 400
화이트밸런스:0
노출:1/200 초
보정:0/1
CCD:23mm
플래쉬:16
이렇게 나옵니다.
자바스크립트로는
<img id="testimg" src="http://img.sir.co.kr/v14/community/logo.gif" />
<script>
var img=document.getElementById('testimg');
document.write(img.width+'x'+img.height); 이렇게 하면 되지 않나?
php로 파일 크기 구해서 하면 될테구요... getimagesize(dimension구할때), filesize 함수 이용하면 됩니다.
<img id="testimg" src="http://img.sir.co.kr/v14/community/logo.gif" />
<script>
var img=document.getElementById('testimg');
document.write(img.width+'x'+img.height); 이렇게 하면 되지 않나?
php로 파일 크기 구해서 하면 될테구요... getimagesize(dimension구할때), filesize 함수 이용하면 됩니다.

옵션님, 레츠고리님 감사합니다~~
잘 써먹겠습니다.. ^^
잘 써먹겠습니다.. ^^