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년 전 조회 2,580
12년 전 조회 4,110
12년 전 조회 2,581
12년 전 조회 9,706
12년 전 조회 2,866
12년 전 조회 5,072
12년 전 조회 7,681
12년 전 조회 2,858
12년 전 조회 4,174
12년 전 조회 1,885
12년 전 조회 2,554
12년 전 조회 2,425
12년 전 조회 2,605
12년 전 조회 4,613
12년 전 조회 2,394
12년 전 조회 3,114
12년 전 조회 2,540
12년 전 조회 2,216
12년 전 조회 2,660
12년 전 조회 3,399
12년 전 조회 2,648
12년 전 조회 2,439
12년 전 조회 2,976
12년 전 조회 1.6만
12년 전 조회 2,257
12년 전 조회 2,065
12년 전 조회 3,857
12년 전 조회 1만
12년 전 조회 2,427
12년 전 조회 2,362
12년 전 조회 2,811
12년 전 조회 2,270
12년 전 조회 2,426
12년 전 조회 4,700
12년 전 조회 2,648
12년 전 조회 3,305
12년 전 조회 2,307
12년 전 조회 2,467
12년 전 조회 4,184
12년 전 조회 2,058
12년 전 조회 2,532
12년 전 조회 2,857
12년 전 조회 3,292
13년 전 조회 3,403
13년 전 조회 3,859
13년 전 조회 2,305
13년 전 조회 2,316
13년 전 조회 5,701
13년 전 조회 2,759
13년 전 조회 2,926
13년 전 조회 6,793
13년 전 조회 4,504
13년 전 조회 3,424
13년 전 조회 2,620
13년 전 조회 4,782
13년 전 조회 3,776
13년 전 조회 3,477
13년 전 조회 3,125
13년 전 조회 2,822
13년 전 조회 2,809
13년 전 조회 2,534
13년 전 조회 3,662
13년 전 조회 2,960
13년 전 조회 2,609
13년 전 조회 3,679
13년 전 조회 2,900
13년 전 조회 3,491
13년 전 조회 4,724
13년 전 조회 2,485
13년 전 조회 3,468
13년 전 조회 2,308
13년 전 조회 2,763
13년 전 조회 3,401
13년 전 조회 3,045
13년 전 조회 5,839
13년 전 조회 3,949
13년 전 조회 4,141
13년 전 조회 2,490
13년 전 조회 9,817
13년 전 조회 4,657
13년 전 조회 2,716
13년 전 조회 2,584
13년 전 조회 3,976
13년 전 조회 6,693
13년 전 조회 4,709
13년 전 조회 2,641
13년 전 조회 1.5만
13년 전 조회 2,496
13년 전 조회 1,926
13년 전 조회 5,148
13년 전 조회 2,635
13년 전 조회 1.1만
13년 전 조회 2,102
13년 전 조회 2,458
13년 전 조회 4,549
13년 전 조회 2,162
13년 전 조회 3,060
13년 전 조회 4,992
13년 전 조회 2,369
13년 전 조회 2,261