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,452
12년 전 조회 2,992
12년 전 조회 1,472
12년 전 조회 8,655
12년 전 조회 1,725
12년 전 조회 3,968
12년 전 조회 6,591
12년 전 조회 1,762
12년 전 조회 3,034
12년 전 조회 789
12년 전 조회 1,489
12년 전 조회 1,347
12년 전 조회 1,512
12년 전 조회 3,508
12년 전 조회 1,283
12년 전 조회 2,012
12년 전 조회 1,455
12년 전 조회 1,108
12년 전 조회 1,585
12년 전 조회 2,309
12년 전 조회 1,582
12년 전 조회 1,478
12년 전 조회 1,996
12년 전 조회 1.5만
12년 전 조회 1,267
12년 전 조회 1,074
12년 전 조회 2,913
12년 전 조회 9,148
12년 전 조회 1,460
12년 전 조회 1,376
12년 전 조회 1,828
12년 전 조회 1,334
12년 전 조회 1,471
12년 전 조회 3,749
12년 전 조회 1,664
12년 전 조회 2,332
12년 전 조회 1,352
12년 전 조회 1,503
12년 전 조회 3,227
12년 전 조회 1,072
12년 전 조회 1,540
12년 전 조회 1,797
12년 전 조회 2,228
12년 전 조회 2,334
12년 전 조회 2,759
12년 전 조회 1,240
12년 전 조회 1,264
12년 전 조회 4,645
12년 전 조회 1,687
12년 전 조회 1,838
12년 전 조회 5,701
12년 전 조회 3,439
12년 전 조회 2,339
12년 전 조회 1,496
12년 전 조회 3,680
12년 전 조회 2,710
12년 전 조회 2,418
12년 전 조회 2,048
12년 전 조회 1,735
12년 전 조회 1,732
12년 전 조회 1,483
12년 전 조회 2,604
12년 전 조회 1,878
12년 전 조회 1,553
12년 전 조회 2,634
12년 전 조회 1,811
12년 전 조회 2,432
12년 전 조회 3,648
12년 전 조회 1,436
12년 전 조회 2,392
12년 전 조회 1,242
12년 전 조회 1,734
12년 전 조회 2,311
12년 전 조회 1,945
12년 전 조회 4,766
12년 전 조회 2,864
12년 전 조회 3,035
12년 전 조회 1,413
12년 전 조회 8,732
12년 전 조회 3,545
12년 전 조회 1,632
12년 전 조회 1,492
12년 전 조회 2,879
12년 전 조회 5,560
12년 전 조회 3,613
12년 전 조회 1,543
12년 전 조회 1.4만
12년 전 조회 1,407
12년 전 조회 816
12년 전 조회 4,126
12년 전 조회 1,634
12년 전 조회 9,527
12년 전 조회 992
12년 전 조회 1,439
12년 전 조회 3,409
12년 전 조회 1,054
12년 전 조회 1,954
12년 전 조회 3,858
12년 전 조회 1,260
12년 전 조회 1,166