<?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년 전
감사합니다
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6730 |
|
11년 전 | 1113 | |
| 6729 | 11년 전 | 569 | ||
| 6728 |
|
11년 전 | 584 | |
| 6727 | 11년 전 | 2427 | ||
| 6726 | 11년 전 | 604 | ||
| 6725 |
네모웹에이전시
|
11년 전 | 447 | |
| 6724 |
네모웹에이전시
|
11년 전 | 890 | |
| 6723 | 11년 전 | 1028 | ||
| 6722 | 11년 전 | 974 | ||
| 6721 | 11년 전 | 658 | ||
| 6720 | 11년 전 | 1982 | ||
| 6719 | 11년 전 | 2203 | ||
| 6718 | 11년 전 | 1112 | ||
| 6717 |
|
11년 전 | 664 | |
| 6716 | 11년 전 | 2312 | ||
| 6715 | 11년 전 | 7583 | ||
| 6714 | 11년 전 | 2052 | ||
| 6713 | 11년 전 | 789 | ||
| 6712 |
geektoo
|
11년 전 | 1161 | |
| 6711 | 11년 전 | 906 | ||
| 6710 |
sirzzang
|
11년 전 | 2137 | |
| 6709 |
bewitched
|
11년 전 | 1804 | |
| 6708 |
levin
|
11년 전 | 578 | |
| 6707 | 11년 전 | 770 | ||
| 6706 | 11년 전 | 1801 | ||
| 6705 | 11년 전 | 994 | ||
| 6704 |
|
11년 전 | 763 | |
| 6703 | 11년 전 | 423 | ||
| 6702 | 11년 전 | 1104 | ||
| 6701 | 11년 전 | 810 | ||
| 6700 | 11년 전 | 1724 | ||
| 6699 | 11년 전 | 723 | ||
| 6698 |
이박사친구
|
11년 전 | 736 | |
| 6697 | 11년 전 | 1221 | ||
| 6696 | 11년 전 | 624 | ||
| 6695 |
Header
|
11년 전 | 708 | |
| 6694 | 11년 전 | 1168 | ||
| 6693 |
|
11년 전 | 1117 | |
| 6692 | 11년 전 | 1153 | ||
| 6691 | 11년 전 | 1291 | ||
| 6690 |
|
11년 전 | 721 | |
| 6689 | 11년 전 | 902 | ||
| 6688 | 12년 전 | 940 | ||
| 6687 | 12년 전 | 542 | ||
| 6686 |
RGB255
|
12년 전 | 966 | |
| 6685 |
|
12년 전 | 645 | |
| 6684 | 12년 전 | 722 | ||
| 6683 | 12년 전 | 391 | ||
| 6682 | 12년 전 | 1136 | ||
| 6681 | 12년 전 | 1427 | ||
| 6680 | 12년 전 | 460 | ||
| 6679 |
RGB255
|
12년 전 | 401 | |
| 6678 | 12년 전 | 1356 | ||
| 6677 |
|
12년 전 | 448 | |
| 6676 | 12년 전 | 1019 | ||
| 6675 |
디자이너필이
|
12년 전 | 830 | |
| 6674 | 12년 전 | 1246 | ||
| 6673 | 12년 전 | 1317 | ||
| 6672 | 12년 전 | 6034 | ||
| 6671 | 12년 전 | 1343 | ||
| 6670 |
하프의정령
|
12년 전 | 577 | |
| 6669 | 12년 전 | 419 | ||
| 6668 |
공부하고가겠슴다
|
12년 전 | 465 | |
| 6667 |
하프의정령
|
12년 전 | 554 | |
| 6666 | 12년 전 | 791 | ||
| 6665 | 12년 전 | 1416 | ||
| 6664 | 12년 전 | 936 | ||
| 6663 | 12년 전 | 1163 | ||
| 6662 | 12년 전 | 421 | ||
| 6661 |
basketball
|
12년 전 | 515 | |
| 6660 | 12년 전 | 2518 | ||
| 6659 | 12년 전 | 1617 | ||
| 6658 |
|
12년 전 | 1341 | |
| 6657 |
|
12년 전 | 3165 | |
| 6656 | 12년 전 | 569 | ||
| 6655 |
프로프리랜서
|
12년 전 | 2338 | |
| 6654 |
프로프리랜서
|
12년 전 | 1916 | |
| 6653 |
프로프리랜서
|
12년 전 | 1751 | |
| 6652 |
프로프리랜서
|
12년 전 | 1835 | |
| 6651 |
|
12년 전 | 787 | |
| 6650 | 12년 전 | 1322 | ||
| 6649 | 12년 전 | 1324 | ||
| 6648 | 12년 전 | 818 | ||
| 6647 | 12년 전 | 3167 | ||
| 6646 | 12년 전 | 475 | ||
| 6645 | 12년 전 | 969 | ||
| 6644 |
BBAYOUNG
|
12년 전 | 1396 | |
| 6643 | 12년 전 | 1805 | ||
| 6642 | 12년 전 | 653 | ||
| 6641 | 12년 전 | 1343 | ||
| 6640 | 12년 전 | 719 | ||
| 6639 | 12년 전 | 2325 | ||
| 6638 |
jasmin2
|
12년 전 | 760 | |
| 6637 |
geektoo
|
12년 전 | 450 | |
| 6636 | 12년 전 | 674 | ||
| 6635 |
프로프리랜서
|
12년 전 | 2238 | |
| 6634 |
프로프리랜서
|
12년 전 | 1744 | |
| 6633 |
프로프리랜서
|
12년 전 | 4061 | |
| 6632 |
프로프리랜서
|
12년 전 | 1351 | |
| 6631 |
프로프리랜서
|
12년 전 | 1791 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기