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,648
12년 전 조회 4,197
12년 전 조회 2,645
12년 전 조회 9,728
12년 전 조회 2,945
12년 전 조회 5,138
12년 전 조회 7,761
12년 전 조회 2,945
12년 전 조회 4,243
12년 전 조회 1,956
12년 전 조회 2,632
12년 전 조회 2,497
12년 전 조회 2,675
12년 전 조회 4,668
12년 전 조회 2,467
12년 전 조회 3,180
12년 전 조회 2,614
12년 전 조회 2,289
12년 전 조회 2,737
12년 전 조회 3,473
12년 전 조회 2,701
12년 전 조회 2,509
12년 전 조회 3,058
12년 전 조회 1.6만
12년 전 조회 2,332
12년 전 조회 2,141
12년 전 조회 3,939
12년 전 조회 1만
12년 전 조회 2,500
12년 전 조회 2,442
12년 전 조회 2,889
12년 전 조회 2,343
12년 전 조회 2,511
12년 전 조회 4,777
12년 전 조회 2,732
12년 전 조회 3,383
12년 전 조회 2,376
12년 전 조회 2,543
12년 전 조회 4,267
12년 전 조회 2,124
12년 전 조회 2,610
13년 전 조회 2,918
13년 전 조회 3,369
13년 전 조회 3,472
13년 전 조회 3,914
13년 전 조회 2,377
13년 전 조회 2,398
13년 전 조회 5,771
13년 전 조회 2,830
13년 전 조회 3,002
13년 전 조회 6,872
13년 전 조회 4,575
13년 전 조회 3,487
13년 전 조회 2,686
13년 전 조회 4,858
13년 전 조회 3,849
13년 전 조회 3,536
13년 전 조회 3,212
13년 전 조회 2,895
13년 전 조회 2,879
13년 전 조회 2,624
13년 전 조회 3,761
13년 전 조회 3,054
13년 전 조회 2,685
13년 전 조회 3,774
13년 전 조회 2,990
13년 전 조회 3,565
13년 전 조회 4,800
13년 전 조회 2,566
13년 전 조회 3,537
13년 전 조회 2,381
13년 전 조회 2,846
13년 전 조회 3,468
13년 전 조회 3,114
13년 전 조회 5,916
13년 전 조회 4,021
13년 전 조회 4,202
13년 전 조회 2,572
13년 전 조회 9,902
13년 전 조회 4,723
13년 전 조회 2,795
13년 전 조회 2,662
13년 전 조회 4,059
13년 전 조회 6,774
13년 전 조회 4,782
13년 전 조회 2,700
13년 전 조회 1.5만
13년 전 조회 2,589
13년 전 조회 1,996
13년 전 조회 5,179
13년 전 조회 2,659
13년 전 조회 1.1만
13년 전 조회 2,181
13년 전 조회 2,491
13년 전 조회 4,617
13년 전 조회 2,228
13년 전 조회 3,125
13년 전 조회 5,056
13년 전 조회 2,433
13년 전 조회 2,328