<?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년 전
감사합니다
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6130 |
gender
|
12년 전 | 1080 | |
| 6129 | 12년 전 | 1318 | ||
| 6128 |
|
12년 전 | 3459 | |
| 6127 | 12년 전 | 693 | ||
| 6126 |
|
12년 전 | 2203 | |
| 6125 |
|
12년 전 | 4880 | |
| 6124 | 12년 전 | 654 | ||
| 6123 | 12년 전 | 3837 | ||
| 6122 | 12년 전 | 1016 | ||
| 6121 | 12년 전 | 3747 | ||
| 6120 | 12년 전 | 905 | ||
| 6119 | 12년 전 | 1767 | ||
| 6118 | 12년 전 | 925 | ||
| 6117 | 12년 전 | 2147 | ||
| 6116 | 12년 전 | 7936 | ||
| 6115 | 12년 전 | 1916 | ||
| 6114 |
|
12년 전 | 1703 | |
| 6113 | 12년 전 | 1520 | ||
| 6112 | 12년 전 | 589 | ||
| 6111 | 12년 전 | 2104 | ||
| 6110 | 12년 전 | 1843 | ||
| 6109 | 12년 전 | 634 | ||
| 6108 | 12년 전 | 1196 | ||
| 6107 | 12년 전 | 615 | ||
| 6106 | 12년 전 | 900 | ||
| 6105 | 12년 전 | 1185 | ||
| 6104 | 12년 전 | 3579 | ||
| 6103 | 12년 전 | 2112 | ||
| 6102 | 12년 전 | 2305 | ||
| 6101 | 12년 전 | 3667 | ||
| 6100 | 12년 전 | 3477 | ||
| 6099 | 12년 전 | 3141 | ||
| 6098 | 12년 전 | 4020 | ||
| 6097 | 12년 전 | 1009 | ||
| 6096 | 12년 전 | 5976 | ||
| 6095 | 12년 전 | 1363 | ||
| 6094 | 12년 전 | 1217 | ||
| 6093 | 12년 전 | 3400 | ||
| 6092 | 12년 전 | 3038 | ||
| 6091 | 12년 전 | 5186 | ||
| 6090 | 12년 전 | 2697 | ||
| 6089 | 12년 전 | 3325 | ||
| 6088 | 12년 전 | 1012 | ||
| 6087 | 12년 전 | 842 | ||
| 6086 | 12년 전 | 2016 | ||
| 6085 |
|
12년 전 | 806 | |
| 6084 |
웹디자인되고파
|
12년 전 | 2213 | |
| 6083 | 12년 전 | 1504 | ||
| 6082 | 12년 전 | 1105 | ||
| 6081 | 12년 전 | 2096 | ||
| 6080 |
Stiven
|
12년 전 | 2309 | |
| 6079 |
프로프리랜서
|
12년 전 | 1311 | |
| 6078 |
프로프리랜서
|
12년 전 | 785 | |
| 6077 |
프로프리랜서
|
12년 전 | 1335 | |
| 6076 |
프로프리랜서
|
12년 전 | 824 | |
| 6075 |
프로프리랜서
|
12년 전 | 1212 | |
| 6074 | 12년 전 | 3852 | ||
| 6073 | 12년 전 | 3947 | ||
| 6072 | 12년 전 | 1370 | ||
| 6071 | 12년 전 | 6981 | ||
| 6070 | 12년 전 | 7561 | ||
| 6069 | 12년 전 | 2313 | ||
| 6068 | 12년 전 | 3864 | ||
| 6067 |
smwkd
|
12년 전 | 629 | |
| 6066 | 12년 전 | 3653 | ||
| 6065 | 12년 전 | 3480 | ||
| 6064 | 12년 전 | 2713 | ||
| 6063 | 12년 전 | 2825 | ||
| 6062 | 12년 전 | 2360 | ||
| 6061 | 12년 전 | 2268 | ||
| 6060 | 12년 전 | 5171 | ||
| 6059 | 12년 전 | 2802 | ||
| 6058 | 12년 전 | 3128 | ||
| 6057 | 12년 전 | 2256 | ||
| 6056 | 12년 전 | 6836 | ||
| 6055 | 12년 전 | 2576 | ||
| 6054 | 12년 전 | 3428 | ||
| 6053 | 12년 전 | 2318 | ||
| 6052 | 12년 전 | 4816 | ||
| 6051 | 12년 전 | 3696 | ||
| 6050 | 12년 전 | 2550 | ||
| 6049 | 12년 전 | 2233 | ||
| 6048 |
|
12년 전 | 1287 | |
| 6047 | 12년 전 | 3427 | ||
| 6046 | 12년 전 | 4087 | ||
| 6045 | 12년 전 | 3453 | ||
| 6044 | 12년 전 | 5328 | ||
| 6043 | 12년 전 | 1647 | ||
| 6042 | 12년 전 | 1274 | ||
| 6041 | 12년 전 | 5161 | ||
| 6040 | 12년 전 | 936 | ||
| 6039 | 12년 전 | 3402 | ||
| 6038 | 12년 전 | 3405 | ||
| 6037 | 12년 전 | 2991 | ||
| 6036 | 12년 전 | 3340 | ||
| 6035 | 12년 전 | 2863 | ||
| 6034 | 12년 전 | 2843 | ||
| 6033 | 12년 전 | 2863 | ||
| 6032 | 12년 전 | 2854 | ||
| 6031 | 12년 전 | 2875 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기