From 1a829148614ddf0143dca837fcefac44b5db52fc Mon Sep 17 00:00:00 2001 From: thisgun Date: Tue, 22 Oct 2019 12:26:53 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=A0=EC=A7=80=EA=B1=B0=EB=82=98=20?= =?UTF-8?q?=EB=B3=B4=EC=99=84=20=ED=95=B4=EC=95=BC=20=ED=95=A0=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/view_image.php | 88 +++++++++++++------ mobile/skin/latest/basic/style.css | 2 +- skin/board/gallery/style.css | 2 +- .../basic/mobile/skin/latest/basic/style.css | 2 +- theme/basic/skin/board/gallery/style.css | 2 +- 5 files changed, 63 insertions(+), 33 deletions(-) diff --git a/bbs/view_image.php b/bbs/view_image.php index c7a7edca7..f988deeb5 100644 --- a/bbs/view_image.php +++ b/bbs/view_image.php @@ -23,57 +23,87 @@ if(strpos($filename, G5_DATA_DIR.'/editor')) { $filepath = G5_DATA_PATH.'/file/'.$bo_table.'/'.$filename; } -if(is_file($filepath)) { - $size = @getimagesize($filepath); +$file_exists = (is_file($filepath) && file_exists($filepath)) ? 1 : 0; + +if(run_replace('exists_view_image', $file_exists, $filepath, $editor_file)) { + $size = $file_exists ? run_replace('get_view_imagesize', @getimagesize($filepath), $filepath, $editor_file) : array(); if(empty($size)) alert_close('이미지 파일이 아닙니다.'); - $width = $size[0]; - $height = $size[1]; + $width = (isset($size[0]) && $size[0]) ? (int) $size[0] : 0; + $height = (isset($size[1]) && $size[1]) ? (int) $size[1] : 0; if($editor_file) $fileurl = G5_DATA_URL.'/'.$editor_file; else $fileurl = G5_DATA_URL.'/file/'.$bo_table.'/'.$filename; - $img = ''; + $img_attr = ($width && $height) ? 'width="'.$width.'" height="'.$height.'"' : ''; + + $img = ''; } else { alert_close('파일이 존재하지 않습니다.'); } ?> -
+