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,433
12년 전 조회 2,980
12년 전 조회 1,460
12년 전 조회 8,635
12년 전 조회 1,702
12년 전 조회 3,953
12년 전 조회 6,563
12년 전 조회 1,749
12년 전 조회 3,016
12년 전 조회 771
12년 전 조회 1,474
12년 전 조회 1,329
12년 전 조회 1,493
12년 전 조회 3,485
12년 전 조회 1,265
12년 전 조회 1,998
12년 전 조회 1,430
12년 전 조회 1,092
12년 전 조회 1,568
12년 전 조회 2,287
12년 전 조회 1,567
12년 전 조회 1,457
12년 전 조회 1,980
12년 전 조회 1.5만
12년 전 조회 1,250
12년 전 조회 1,054
12년 전 조회 2,896
12년 전 조회 9,128
12년 전 조회 1,447
12년 전 조회 1,353
12년 전 조회 1,808
12년 전 조회 1,317
12년 전 조회 1,458
12년 전 조회 3,729
12년 전 조회 1,640
12년 전 조회 2,309
12년 전 조회 1,332
12년 전 조회 1,482
12년 전 조회 3,207
12년 전 조회 1,050
12년 전 조회 1,523
12년 전 조회 1,786
12년 전 조회 2,204
12년 전 조회 2,312
12년 전 조회 2,740
12년 전 조회 1,227
12년 전 조회 1,247
12년 전 조회 4,625
12년 전 조회 1,668
12년 전 조회 1,818
12년 전 조회 5,680
12년 전 조회 3,424
12년 전 조회 2,323
12년 전 조회 1,473
12년 전 조회 3,659
12년 전 조회 2,683
12년 전 조회 2,400
12년 전 조회 2,024
12년 전 조회 1,708
12년 전 조회 1,712
12년 전 조회 1,465
12년 전 조회 2,580
12년 전 조회 1,860
12년 전 조회 1,533
12년 전 조회 2,617
12년 전 조회 1,784
12년 전 조회 2,412
12년 전 조회 3,628
12년 전 조회 1,413
12년 전 조회 2,377
12년 전 조회 1,231
12년 전 조회 1,711
12년 전 조회 2,290
12년 전 조회 1,925
12년 전 조회 4,742
12년 전 조회 2,845
12년 전 조회 3,018
12년 전 조회 1,385
12년 전 조회 8,714
12년 전 조회 3,524
12년 전 조회 1,610
12년 전 조회 1,467
12년 전 조회 2,863
12년 전 조회 5,542
12년 전 조회 3,597
12년 전 조회 1,520
12년 전 조회 1.4만
12년 전 조회 1,389
12년 전 조회 793
12년 전 조회 4,109
12년 전 조회 1,607
12년 전 조회 9,506
12년 전 조회 973
12년 전 조회 1,415
12년 전 조회 3,394
12년 전 조회 1,027
12년 전 조회 1,938
12년 전 조회 3,834
12년 전 조회 1,246
12년 전 조회 1,151
🐛 버그신고