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,481
12년 전 조회 3,029
12년 전 조회 1,509
12년 전 조회 8,685
12년 전 조회 1,750
12년 전 조회 3,999
12년 전 조회 6,627
12년 전 조회 1,793
12년 전 조회 3,059
12년 전 조회 821
12년 전 조회 1,520
12년 전 조회 1,376
12년 전 조회 1,533
12년 전 조회 3,539
12년 전 조회 1,321
12년 전 조회 2,048
12년 전 조회 1,486
12년 전 조회 1,140
12년 전 조회 1,616
12년 전 조회 2,336
12년 전 조회 1,607
12년 전 조회 1,514
12년 전 조회 2,028
12년 전 조회 1.5만
12년 전 조회 1,292
12년 전 조회 1,107
12년 전 조회 2,949
12년 전 조회 9,179
12년 전 조회 1,494
12년 전 조회 1,405
12년 전 조회 1,856
12년 전 조회 1,367
12년 전 조회 1,506
12년 전 조회 3,786
12년 전 조회 1,687
12년 전 조회 2,366
12년 전 조회 1,391
12년 전 조회 1,542
12년 전 조회 3,251
12년 전 조회 1,102
12년 전 조회 1,574
12년 전 조회 1,829
12년 전 조회 2,261
12년 전 조회 2,375
12년 전 조회 2,795
12년 전 조회 1,275
12년 전 조회 1,297
12년 전 조회 4,680
12년 전 조회 1,725
12년 전 조회 1,873
12년 전 조회 5,736
12년 전 조회 3,468
12년 전 조회 2,375
12년 전 조회 1,526
12년 전 조회 3,715
12년 전 조회 2,739
12년 전 조회 2,448
12년 전 조회 2,077
12년 전 조회 1,764
12년 전 조회 1,760
12년 전 조회 1,512
12년 전 조회 2,635
12년 전 조회 1,911
12년 전 조회 1,588
12년 전 조회 2,671
12년 전 조회 1,845
12년 전 조회 2,461
12년 전 조회 3,684
12년 전 조회 1,468
12년 전 조회 2,428
12년 전 조회 1,278
12년 전 조회 1,769
12년 전 조회 2,341
12년 전 조회 1,980
12년 전 조회 4,795
12년 전 조회 2,893
12년 전 조회 3,074
12년 전 조회 1,439
12년 전 조회 8,755
12년 전 조회 3,582
12년 전 조회 1,657
12년 전 조회 1,526
12년 전 조회 2,910
12년 전 조회 5,585
12년 전 조회 3,639
12년 전 조회 1,571
12년 전 조회 1.4만
12년 전 조회 1,442
12년 전 조회 845
12년 전 조회 4,154
12년 전 조회 1,659
12년 전 조회 9,554
12년 전 조회 1,020
12년 전 조회 1,471
12년 전 조회 3,434
12년 전 조회 1,077
12년 전 조회 1,985
12년 전 조회 3,883
12년 전 조회 1,294
12년 전 조회 1,194