기본 콘텐츠로 건너뛰기

2월, 2017의 게시물 표시

PHP - make thumbnail image [thumbnail Image 만들기]

function make_thumb($src, $dest, $desired_width) {     /* read the source image */     $source_image = imagecreatefromjpeg($src);     $width = imagesx($source_image);     $height = imagesy($source_image);     /* find the "desired height" of this thumbnail, relative to the desired width  */     $desired_height = floor($height * ($desired_width / $width));     /* create a new, "virtual" image */     $virtual_image = imagecreatetruecolor($desired_width, $desired_height);     /* copy source image at a resized size */     imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);     /* create the physical thumbnail image to its destination */     imagejpeg($virtual_image, $dest); }

PHP - read file list from Directory [Directory 내 파일 목록 읽기]

$path = 'ftp://admin:herald@herald.ipdisk.co.kr/HDD2/photo/Best/'; $thumbpath = $path . 'thumb/'; $thumb_size = 200; if (!file_exists($thumbpath)) {     mkdir($thumbpath, 0777, true); } $files = array(); $handle = @opendir($path) or die("Unable to open $path"); //  $handle = @opendir($path) or die("Unable to open $path"); while ($file = @readdir($handle)) ("." !== $file && ".." !== $file) && array_push($files, $file); @closedir($handle); sort($files); //uksort($files, "strnatcasecmp"); foreach ($files as $filename){     //echo $filename + "\n";     $src = $path . $filename;     $dest = $thumbpath . $filename;     //echo 'source file : ' . $src . ' === ' . 'destination file : ' . $dest . "\n";     //if (!file_exists($dest) && !is_dir($filename))     //    echo $dest . ' file not exist';//make_thumb($src, $dest, $thumb_size);...

Bootstrap - Image enlarge with modal [이미지 확대 with modal]

<a href = "#" id = "pop" > <img id = "imageresource" src = "http://patyshibuya.com.br/wp-content/uploads/2014/04/04.jpg" style = " width : 400px ; height : 264px ; " > Click to Enlarge </a> <!-- Creates the bootstrap modal where the image will appear --> <div class = "modal fade" id = "imagemodal" tabindex = "-1" role = "dialog" aria-labelledby = "myModalLabel" aria-hidden = "true" > <div class = "modal-dialog" > <div class = "modal-content" > <div class = "modal-header" > <button type = "button" class = "close" data-dismiss = "modal" ><span aria-hidden = "true" > &times; </span><span class = "sr-only" > Close </span></button> <h4 class = ...

Bootstrap - .row, .col-*-*

http://getbootstrap.com/examples/grid/ .row .container 또는 .container-fluid 안에 .row 로 행을 만듭니다. .col-*-* .row 안에 .col-*-* 로 열을 만듭니다. 첫번째 * 에는 xs, sm, md, lg 중의 하나가, 두번째 * 에는 1부터 12까지의 수 중의 하나가 들어갑니다. xs : 항상 적용됩니다. sm : 가로 해상도 768px 이상에서 적용됩니다. md : 가로 해상도 992px 이상에서 적용됩니다. lg : 가로 해상도 1200px 이상에서 적용됩니다. 1 - 12 : 행을 12등분하여 그 중 몇 개를 사용할 지 정합니다. .col-xs-* 예를 들어 .col-xs-6 은 항상 행의 6/12을 가로 크기로 한다는 뜻이고, .col-xs-3 은 항상 행의 3/12을 가로 크기로 한다는 뜻입니다. 행을 12등분했으므로, 숫자의 합이 12면 .container ( .container-fluid )를 꽉 채웁니다. 숫자의 합이 12보다 작으면 오른쪽에 공간이 남으며, 12보다 크면 다음 줄로 넘어갑니다. 예제 1 <!DOCTYPE html> < html lang = " ko " > < head > < meta charset = " utf-8 " > < meta http-equiv = " X-UA-Compatible " content = " IE = edge " > < meta name = " viewport " content = " width = device-width, initial-scale = 1 " > < title > Bootstrap | Grid System </ title > ...