<?php
//이미지 처리 함수 인클루드
include_once 'lib/image_proc.function.php';
$path_file = 'sample_image/test.jpg';//원본파일
$path_mark_file ='sample_image/php.png';//워터마크에 사용할 파일
$path_save_file = 'sample_image/watermak.jpg';//워터마크 처리한 것을 저장할 파일
//원본의 이미지 리소스를 받아온다.
list($src, $src_w, $src_h) = get_image_resource_from_file ($path_file);
if (empty($src)) die($GLOBALS['errormsg'] . "<br />\n");
//워터마크에 사용될 이미지 리소스를 받아온다.
list($mark, $mark_w, $mark_h) = get_image_resource_from_file ($path_mark_file);
if (empty($mark)) die($GLOBALS['errormsg'] . "<br />\n");
//원본의 왼쪽 꼭지점을 기준점으로 선명도 60으로 워터마크 처리
$result_watermark = imagecopymerge($src, $mark, 0, 0, 0, 0, $mark_w, $mark_h, 60);
if ($result_watermark === false) die("워터마크 처리에 실패하였습니다.<br />\n");
$result_save = save_image_from_resource ($src, $path_save_file);//저장
if ($result_save === false) die($GLOBALS['errormsg'] . "<br />\n");
@imagedestroy($mark);
@imagedestroy($src);
//성공하였다면 이미지 출력
?>
원본 이미지 <br />
<img src='<?=$path_file?>'> <br />
워터마크에 사용할 이미지 <br />
<img src='<?=$path_mark_file?>'> <br />
워터마크 처리한 이미지 <br />
<img src='<?=$path_save_file?>'> <br />
//이미지 처리 함수 인클루드
include_once 'lib/image_proc.function.php';
$path_file = 'sample_image/test.jpg';//원본파일
$path_mark_file ='sample_image/php.png';//워터마크에 사용할 파일
$path_save_file = 'sample_image/watermak.jpg';//워터마크 처리한 것을 저장할 파일
//원본의 이미지 리소스를 받아온다.
list($src, $src_w, $src_h) = get_image_resource_from_file ($path_file);
if (empty($src)) die($GLOBALS['errormsg'] . "<br />\n");
//워터마크에 사용될 이미지 리소스를 받아온다.
list($mark, $mark_w, $mark_h) = get_image_resource_from_file ($path_mark_file);
if (empty($mark)) die($GLOBALS['errormsg'] . "<br />\n");
//원본의 왼쪽 꼭지점을 기준점으로 선명도 60으로 워터마크 처리
$result_watermark = imagecopymerge($src, $mark, 0, 0, 0, 0, $mark_w, $mark_h, 60);
if ($result_watermark === false) die("워터마크 처리에 실패하였습니다.<br />\n");
$result_save = save_image_from_resource ($src, $path_save_file);//저장
if ($result_save === false) die($GLOBALS['errormsg'] . "<br />\n");
@imagedestroy($mark);
@imagedestroy($src);
//성공하였다면 이미지 출력
?>
원본 이미지 <br />
<img src='<?=$path_file?>'> <br />
워터마크에 사용할 이미지 <br />
<img src='<?=$path_mark_file?>'> <br />
워터마크 처리한 이미지 <br />
<img src='<?=$path_save_file?>'> <br />
참고 : http://kr2.php.net/manual/kr/function.ceil.php
댓글 2개
takumi22
12년 전
유창화님 강의네요 ~~
12년 전
감사합니다
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 130 | 20년 전 | 3989 | ||
| 129 | 20년 전 | 2927 | ||
| 128 | 20년 전 | 3665 | ||
| 127 | 20년 전 | 3491 | ||
| 126 | 20년 전 | 3752 | ||
| 125 | 20년 전 | 8582 | ||
| 124 | 20년 전 | 2597 | ||
| 123 | 20년 전 | 3742 | ||
| 122 | 20년 전 | 3204 | ||
| 121 | 20년 전 | 2606 | ||
| 120 | 20년 전 | 2663 | ||
| 119 | 20년 전 | 2578 | ||
| 118 | 20년 전 | 2858 | ||
| 117 |
|
20년 전 | 3050 | |
| 116 | 20년 전 | 5300 | ||
| 115 | 20년 전 | 3915 | ||
| 114 | 20년 전 | 4964 | ||
| 113 | 20년 전 | 6206 | ||
| 112 | 20년 전 | 7319 | ||
| 111 | 20년 전 | 18427 | ||
| 110 | 20년 전 | 6870 | ||
| 109 | 20년 전 | 2871 | ||
| 108 | 20년 전 | 4136 | ||
| 107 |
prosper
|
20년 전 | 2489 | |
| 106 |
prosper
|
20년 전 | 4314 | |
| 105 |
아우겐나이스
|
20년 전 | 2907 | |
| 104 | 20년 전 | 2255 | ||
| 103 | 20년 전 | 2473 | ||
| 102 | 20년 전 | 2244 | ||
| 101 | 20년 전 | 2570 | ||
| 100 | 20년 전 | 1742 | ||
| 99 | 20년 전 | 1562 | ||
| 98 | 20년 전 | 1614 | ||
| 97 | 20년 전 | 2126 | ||
| 96 | 20년 전 | 1869 | ||
| 95 | 20년 전 | 2368 | ||
| 94 | 20년 전 | 3562 | ||
| 93 | 20년 전 | 1557 | ||
| 92 | 20년 전 | 1751 | ||
| 91 | 20년 전 | 3177 | ||
| 90 | 20년 전 | 2339 | ||
| 89 | 20년 전 | 3166 | ||
| 88 | 20년 전 | 2868 | ||
| 87 | 20년 전 | 3292 | ||
| 86 | 20년 전 | 5126 | ||
| 85 | 20년 전 | 2515 | ||
| 84 | 20년 전 | 4821 | ||
| 83 | 20년 전 | 2499 | ||
| 82 | 20년 전 | 3117 | ||
| 81 | 20년 전 | 7618 | ||
| 80 | 20년 전 | 3819 | ||
| 79 | 20년 전 | 3205 | ||
| 78 | 20년 전 | 4690 | ||
| 77 | 20년 전 | 2893 | ||
| 76 | 20년 전 | 6213 | ||
| 75 | 20년 전 | 4470 | ||
| 74 | 20년 전 | 5777 | ||
| 73 | 20년 전 | 3622 | ||
| 72 | 20년 전 | 5964 | ||
| 71 | 20년 전 | 3110 | ||
| 70 | 20년 전 | 2833 | ||
| 69 | 20년 전 | 2634 | ||
| 68 | 20년 전 | 2443 | ||
| 67 | 20년 전 | 2648 | ||
| 66 | 20년 전 | 2666 | ||
| 65 | 20년 전 | 3783 | ||
| 64 | 20년 전 | 2820 | ||
| 63 | 20년 전 | 2452 | ||
| 62 | 20년 전 | 2261 | ||
| 61 | 20년 전 | 3066 | ||
| 60 | 20년 전 | 3129 | ||
| 59 | 20년 전 | 2509 | ||
| 58 | 20년 전 | 2587 | ||
| 57 | 20년 전 | 2962 | ||
| 56 | 20년 전 | 2314 | ||
| 55 | 20년 전 | 2758 | ||
| 54 | 20년 전 | 2124 | ||
| 53 | 20년 전 | 2346 | ||
| 52 | 20년 전 | 2693 | ||
| 51 |
prosper
|
21년 전 | 2346 | |
| 50 |
prosper
|
21년 전 | 2166 | |
| 49 | 21년 전 | 2174 | ||
| 48 | 21년 전 | 2329 | ||
| 47 | 21년 전 | 1927 | ||
| 46 | 21년 전 | 1927 | ||
| 45 | 21년 전 | 2130 | ||
| 44 | 21년 전 | 2355 | ||
| 43 | 21년 전 | 4568 | ||
| 42 |
prosper
|
21년 전 | 2712 | |
| 41 |
prosper
|
21년 전 | 2110 | |
| 40 | 21년 전 | 2178 | ||
| 39 | 21년 전 | 2141 | ||
| 38 | 21년 전 | 2416 | ||
| 37 | 21년 전 | 2563 | ||
| 36 | 21년 전 | 1769 | ||
| 35 | 21년 전 | 4069 | ||
| 34 | 21년 전 | 3849 | ||
| 33 | 21년 전 | 2989 | ||
| 32 |
prosper
|
21년 전 | 2898 | |
| 31 | 21년 전 | 5273 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기