diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index b395e0734..c7991dbef 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -184,7 +184,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h // Animated GIF는 썸네일 생성하지 않음 if($size[2] == 1) { if(is_animated_gif($source_file)) - return; + return basename($source_file); } $thumb_time = @filemtime($thumb_file); diff --git a/skin/board/basic/view.skin.php b/skin/board/basic/view.skin.php index 3a8859118..316767c06 100644 --- a/skin/board/basic/view.skin.php +++ b/skin/board/basic/view.skin.php @@ -217,6 +217,35 @@ $(window).load(function() { view_image_resize(); }); +var now = new Date(); +var timeout = false; +var millisec = 200; +var tid; + +$(window).resize(function() { + now = new Date(); + if (timeout === false) { + timeout = true; + + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); + } +}); + +function resize_check() { + if (new Date() - now < millisec) { + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); + } else { + timeout = false; + view_image_resize(); + } +} + $(function() { $("a.view_image").click(function() { window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no"); @@ -240,14 +269,27 @@ function view_image_resize() { var $img = $("#bo_v_atc img"); var img_wrap = $("#bo_v_atc").width(); + var win_width = $(window).width() - 35; + var res_width = 0; + + if(img_wrap < win_width) + res_width = img_wrap; + else + res_width = win_width; $img.each(function() { var img_width = $(this).width(); - $(this).data("width", img_width); // 원래 이미지 사이즈 - if (img_width > img_wrap) { - $(this).addClass("img_fix"); - } else if (img_width <= img_wrap && img_width >= $(this).data("width")) { - $(this).removeClass("img_fix"); + var this_width = $(this).data("width"); + + if(this_width == undefined) { + $(this).data("width", img_width); // 원래 이미지 사이즈 + this_width = img_width; + } + + if(this_width > res_width) { + $(this).width(res_width); + } else { + $(this).width(this_width); } }); } diff --git a/skin/board/gallery/view.skin.php b/skin/board/gallery/view.skin.php index a889e4a88..19ecc715b 100644 --- a/skin/board/gallery/view.skin.php +++ b/skin/board/gallery/view.skin.php @@ -215,6 +215,35 @@ $(window).load(function() { view_image_resize(); }); +var now = new Date(); +var timeout = false; +var millisec = 200; +var tid; + +$(window).resize(function() { + now = new Date(); + if (timeout === false) { + timeout = true; + + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); + } +}); + +function resize_check() { + if (new Date() - now < millisec) { + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); + } else { + timeout = false; + view_image_resize(); + } +} + $(function() { $("a.view_image").click(function() { window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no"); @@ -238,14 +267,27 @@ function view_image_resize() { var $img = $("#bo_v_atc img"); var img_wrap = $("#bo_v_atc").width(); + var win_width = $(window).width() - 35; + var res_width = 0; + + if(img_wrap < win_width) + res_width = img_wrap; + else + res_width = win_width; $img.each(function() { var img_width = $(this).width(); - $(this).data("width", img_width); // 원래 이미지 사이즈 - if (img_width > img_wrap) { - $(this).addClass("img_fix"); - } else if (img_width <= img_wrap && img_width >= $(this).data("width")) { - $(this).removeClass("img_fix"); + var this_width = $(this).data("width"); + + if(this_width == undefined) { + $(this).data("width", img_width); // 원래 이미지 사이즈 + this_width = img_width; + } + + if(this_width > res_width) { + $(this).width(res_width); + } else { + $(this).width(this_width); } }); }