<?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년 전
감사합니다
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7430 |
|
11년 전 | 4947 | |
| 7429 | 11년 전 | 1780 | ||
| 7428 |
멋진남자임
|
11년 전 | 1174 | |
| 7427 |
sdflksdj2
|
11년 전 | 831 | |
| 7426 | 11년 전 | 1366 | ||
| 7425 | 11년 전 | 1393 | ||
| 7424 | 11년 전 | 1054 | ||
| 7423 |
SeungYeon
|
11년 전 | 565 | |
| 7422 | 11년 전 | 811 | ||
| 7421 |
sdflksdj2
|
11년 전 | 691 | |
| 7420 | 11년 전 | 974 | ||
| 7419 |
|
11년 전 | 1405 | |
| 7418 |
멋진남자임
|
11년 전 | 1444 | |
| 7417 | 11년 전 | 608 | ||
| 7416 |
senseme
|
11년 전 | 1233 | |
| 7415 | 11년 전 | 963 | ||
| 7414 | 11년 전 | 715 | ||
| 7413 | 11년 전 | 4851 | ||
| 7412 | 11년 전 | 4408 | ||
| 7411 |
holla
|
11년 전 | 898 | |
| 7410 | 11년 전 | 4254 | ||
| 7409 | 11년 전 | 3929 | ||
| 7408 | 11년 전 | 4273 | ||
| 7407 | 11년 전 | 5091 | ||
| 7406 | 11년 전 | 4737 | ||
| 7405 | 11년 전 | 4303 | ||
| 7404 | 11년 전 | 765 | ||
| 7403 | 11년 전 | 5685 | ||
| 7402 | 11년 전 | 1522 | ||
| 7401 |
|
11년 전 | 979 | |
| 7400 | 11년 전 | 2975 | ||
| 7399 |
멋진남자임
|
11년 전 | 920 | |
| 7398 |
파랑새1597
|
11년 전 | 2709 | |
| 7397 | 11년 전 | 2278 | ||
| 7396 |
basketball
|
11년 전 | 1378 | |
| 7395 | 11년 전 | 1616 | ||
| 7394 | 11년 전 | 934 | ||
| 7393 | 11년 전 | 2075 | ||
| 7392 | 11년 전 | 852 | ||
| 7391 |
잘살아보자
|
11년 전 | 5366 | |
| 7390 |
잘살아보자
|
11년 전 | 2231 | |
| 7389 |
잘살아보자
|
11년 전 | 3323 | |
| 7388 |
파랑새1597
|
11년 전 | 932 | |
| 7387 | 11년 전 | 1108 | ||
| 7386 |
프리랜서퍼블리셔
|
11년 전 | 974 | |
| 7385 | 11년 전 | 1572 | ||
| 7384 |
울라라라우
|
11년 전 | 893 | |
| 7383 | 11년 전 | 1559 | ||
| 7382 |
잘살아보자
|
11년 전 | 4230 | |
| 7381 |
잘살아보자
|
11년 전 | 2002 | |
| 7380 |
잘살아보자
|
11년 전 | 1945 | |
| 7379 |
잘살아보자
|
11년 전 | 5912 | |
| 7378 |
senseme
|
11년 전 | 1902 | |
| 7377 |
잘살아보자
|
11년 전 | 2751 | |
| 7376 | 11년 전 | 2420 | ||
| 7375 |
잘살아보자
|
11년 전 | 1053 | |
| 7374 |
잘살아보자
|
11년 전 | 3166 | |
| 7373 |
잘살아보자
|
11년 전 | 2483 | |
| 7372 |
잘살아보자
|
11년 전 | 5834 | |
| 7371 |
잘살아보자
|
11년 전 | 3470 | |
| 7370 |
잘살아보자
|
11년 전 | 1917 | |
| 7369 |
잘살아보자
|
11년 전 | 2175 | |
| 7368 |
ksdhtm56
|
11년 전 | 575 | |
| 7367 | 11년 전 | 1438 | ||
| 7366 | 11년 전 | 937 | ||
| 7365 | 11년 전 | 3551 | ||
| 7364 |
잘살아보자
|
11년 전 | 1401 | |
| 7363 |
잘살아보자
|
11년 전 | 1373 | |
| 7362 |
잘살아보자
|
11년 전 | 1515 | |
| 7361 | 11년 전 | 3600 | ||
| 7360 | 11년 전 | 3564 | ||
| 7359 | 11년 전 | 3383 | ||
| 7358 |
멋진남자임
|
11년 전 | 1034 | |
| 7357 | 11년 전 | 3419 | ||
| 7356 | 11년 전 | 2608 | ||
| 7355 | 11년 전 | 3198 | ||
| 7354 |
파랑새1597
|
11년 전 | 653 | |
| 7353 |
잘살아보자
|
11년 전 | 2430 | |
| 7352 |
잘살아보자
|
11년 전 | 2421 | |
| 7351 |
잘살아보자
|
11년 전 | 2483 | |
| 7350 |
잘살아보자
|
11년 전 | 1478 | |
| 7349 |
잘살아보자
|
11년 전 | 1971 | |
| 7348 |
잘살아보자
|
11년 전 | 1288 | |
| 7347 |
잘살아보자
|
11년 전 | 1084 | |
| 7346 |
멋진남자임
|
11년 전 | 1652 | |
| 7345 | 11년 전 | 996 | ||
| 7344 | 11년 전 | 3880 | ||
| 7343 | 11년 전 | 3663 | ||
| 7342 | 11년 전 | 1288 | ||
| 7341 | 11년 전 | 2526 | ||
| 7340 |
|
11년 전 | 941 | |
| 7339 | 11년 전 | 1740 | ||
| 7338 | 11년 전 | 3352 | ||
| 7337 | 11년 전 | 3666 | ||
| 7336 | 11년 전 | 4605 | ||
| 7335 | 11년 전 | 982 | ||
| 7334 | 11년 전 | 1540 | ||
| 7333 | 11년 전 | 2942 | ||
| 7332 |
|
11년 전 | 1114 | |
| 7331 |
KeePin뽁이
|
11년 전 | 1108 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기