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,798
12년 전 조회 4,345
12년 전 조회 2,800
12년 전 조회 9,820
12년 전 조회 3,103
12년 전 조회 5,299
12년 전 조회 7,937
12년 전 조회 3,126
12년 전 조회 4,395
12년 전 조회 2,124
12년 전 조회 2,795
12년 전 조회 2,663
12년 전 조회 2,855
12년 전 조회 4,842
12년 전 조회 2,635
12년 전 조회 3,339
12년 전 조회 2,763
12년 전 조회 2,465
12년 전 조회 2,893
13년 전 조회 3,650
13년 전 조회 2,856
13년 전 조회 2,674
13년 전 조회 3,239
13년 전 조회 1.6만
13년 전 조회 2,494
13년 전 조회 2,291
13년 전 조회 4,109
13년 전 조회 1만
13년 전 조회 2,669
13년 전 조회 2,630
13년 전 조회 3,060
13년 전 조회 2,522
13년 전 조회 2,679
13년 전 조회 4,953
13년 전 조회 2,910
13년 전 조회 3,553
13년 전 조회 2,547
13년 전 조회 2,732
13년 전 조회 4,461
13년 전 조회 2,301
13년 전 조회 2,792
13년 전 조회 3,096
13년 전 조회 3,541
13년 전 조회 3,638
13년 전 조회 4,090
13년 전 조회 2,556
13년 전 조회 2,565
13년 전 조회 5,957
13년 전 조회 3,019
13년 전 조회 3,182
13년 전 조회 7,052
13년 전 조회 4,722
13년 전 조회 3,672
13년 전 조회 2,849
13년 전 조회 5,026
13년 전 조회 4,042
13년 전 조회 3,716
13년 전 조회 3,403
13년 전 조회 3,075
13년 전 조회 3,058
13년 전 조회 2,817
13년 전 조회 3,940
13년 전 조회 3,247
13년 전 조회 2,859
13년 전 조회 3,959
13년 전 조회 3,170
13년 전 조회 3,769
13년 전 조회 4,977
13년 전 조회 2,750
13년 전 조회 3,704
13년 전 조회 2,543
13년 전 조회 3,041
13년 전 조회 3,651
13년 전 조회 3,297
13년 전 조회 6,109
13년 전 조회 4,222
13년 전 조회 4,396
13년 전 조회 2,775
13년 전 조회 1만
13년 전 조회 4,912
13년 전 조회 2,981
13년 전 조회 2,859
13년 전 조회 4,252
13년 전 조회 6,985
13년 전 조회 4,974
13년 전 조회 2,894
13년 전 조회 1.5만
13년 전 조회 2,773
13년 전 조회 2,204
13년 전 조회 5,267
13년 전 조회 2,738
13년 전 조회 1.1만
13년 전 조회 2,390
13년 전 조회 2,578
13년 전 조회 4,823
13년 전 조회 2,424
13년 전 조회 3,341
13년 전 조회 5,261
13년 전 조회 2,631
13년 전 조회 2,531