s

이미지에 워터마크 처리하기

<?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 />



참고 : http://kr2.php.net/manual/kr/function.ceil.php
|

댓글 2개

유창화님 강의네요 ~~
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
12년 전 조회 1,462
12년 전 조회 3,005
12년 전 조회 1,489
12년 전 조회 8,665
12년 전 조회 1,741
12년 전 조회 3,981
12년 전 조회 6,605
12년 전 조회 1,775
12년 전 조회 3,046
12년 전 조회 802
12년 전 조회 1,500
12년 전 조회 1,363
12년 전 조회 1,520
12년 전 조회 3,524
12년 전 조회 1,298
12년 전 조회 2,025
12년 전 조회 1,466
12년 전 조회 1,121
12년 전 조회 1,597
12년 전 조회 2,318
12년 전 조회 1,591
12년 전 조회 1,492
12년 전 조회 2,008
12년 전 조회 1.5만
12년 전 조회 1,282
12년 전 조회 1,090
12년 전 조회 2,928
12년 전 조회 9,163
12년 전 조회 1,478
12년 전 조회 1,385
12년 전 조회 1,837
12년 전 조회 1,353
12년 전 조회 1,486
12년 전 조회 3,759
12년 전 조회 1,674
12년 전 조회 2,349
12년 전 조회 1,365
12년 전 조회 1,520
12년 전 조회 3,241
12년 전 조회 1,089
12년 전 조회 1,556
12년 전 조회 1,810
12년 전 조회 2,246
12년 전 조회 2,347
12년 전 조회 2,771
12년 전 조회 1,257
12년 전 조회 1,279
12년 전 조회 4,657
12년 전 조회 1,705
12년 전 조회 1,855
12년 전 조회 5,713
12년 전 조회 3,450
12년 전 조회 2,357
12년 전 조회 1,511
12년 전 조회 3,696
12년 전 조회 2,723
12년 전 조회 2,431
12년 전 조회 2,062
12년 전 조회 1,754
12년 전 조회 1,746
12년 전 조회 1,498
12년 전 조회 2,614
12년 전 조회 1,896
12년 전 조회 1,565
12년 전 조회 2,651
12년 전 조회 1,825
12년 전 조회 2,443
12년 전 조회 3,662
12년 전 조회 1,447
12년 전 조회 2,408
12년 전 조회 1,261
12년 전 조회 1,747
12년 전 조회 2,325
12년 전 조회 1,961
12년 전 조회 4,780
12년 전 조회 2,875
12년 전 조회 3,055
12년 전 조회 1,424
12년 전 조회 8,745
12년 전 조회 3,564
12년 전 조회 1,640
12년 전 조회 1,508
12년 전 조회 2,891
12년 전 조회 5,571
12년 전 조회 3,627
12년 전 조회 1,553
12년 전 조회 1.4만
12년 전 조회 1,420
12년 전 조회 827
12년 전 조회 4,136
12년 전 조회 1,645
12년 전 조회 9,537
12년 전 조회 1,002
12년 전 조회 1,452
12년 전 조회 3,419
12년 전 조회 1,065
12년 전 조회 1,971
12년 전 조회 3,868
12년 전 조회 1,273
12년 전 조회 1,174