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,560
12년 전 조회 4,084
12년 전 조회 2,552
12년 전 조회 9,700
12년 전 조회 2,832
12년 전 조회 5,061
12년 전 조회 7,663
12년 전 조회 2,833
12년 전 조회 4,143
12년 전 조회 1,854
12년 전 조회 2,533
12년 전 조회 2,406
12년 전 조회 2,589
12년 전 조회 4,592
12년 전 조회 2,367
12년 전 조회 3,089
12년 전 조회 2,521
12년 전 조회 2,189
12년 전 조회 2,640
12년 전 조회 3,368
12년 전 조회 2,628
12년 전 조회 2,414
12년 전 조회 2,951
12년 전 조회 1.6만
12년 전 조회 2,234
12년 전 조회 2,050
12년 전 조회 3,828
12년 전 조회 1만
12년 전 조회 2,401
12년 전 조회 2,341
12년 전 조회 2,784
12년 전 조회 2,250
12년 전 조회 2,402
12년 전 조회 4,679
12년 전 조회 2,622
12년 전 조회 3,290
12년 전 조회 2,288
12년 전 조회 2,442
12년 전 조회 4,164
12년 전 조회 2,023
12년 전 조회 2,512
12년 전 조회 2,829
12년 전 조회 3,268
12년 전 조회 3,380
12년 전 조회 3,845
13년 전 조회 2,279
13년 전 조회 2,290
13년 전 조회 5,685
13년 전 조회 2,743
13년 전 조회 2,913
13년 전 조회 6,771
13년 전 조회 4,482
13년 전 조회 3,410
13년 전 조회 2,601
13년 전 조회 4,765
13년 전 조회 3,756
13년 전 조회 3,451
13년 전 조회 3,098
13년 전 조회 2,796
13년 전 조회 2,781
13년 전 조회 2,510
13년 전 조회 3,643
13년 전 조회 2,938
13년 전 조회 2,594
13년 전 조회 3,660
13년 전 조회 2,873
13년 전 조회 3,475
13년 전 조회 4,703
13년 전 조회 2,462
13년 전 조회 3,451
13년 전 조회 2,285
13년 전 조회 2,746
13년 전 조회 3,379
13년 전 조회 3,027
13년 전 조회 5,812
13년 전 조회 3,935
13년 전 조회 4,123
13년 전 조회 2,468
13년 전 조회 9,799
13년 전 조회 4,642
13년 전 조회 2,702
13년 전 조회 2,562
13년 전 조회 3,948
13년 전 조회 6,672
13년 전 조회 4,685
13년 전 조회 2,609
13년 전 조회 1.5만
13년 전 조회 2,482
13년 전 조회 1,911
13년 전 조회 5,144
13년 전 조회 2,635
13년 전 조회 1.1만
13년 전 조회 2,087
13년 전 조회 2,455
13년 전 조회 4,532
13년 전 조회 2,140
13년 전 조회 3,040
13년 전 조회 4,961
13년 전 조회 2,350
13년 전 조회 2,246