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,431
12년 전 조회 2,975
12년 전 조회 1,458
12년 전 조회 8,629
12년 전 조회 1,698
12년 전 조회 3,950
12년 전 조회 6,560
12년 전 조회 1,747
12년 전 조회 3,013
12년 전 조회 770
12년 전 조회 1,472
12년 전 조회 1,328
12년 전 조회 1,490
12년 전 조회 3,481
12년 전 조회 1,264
12년 전 조회 1,997
12년 전 조회 1,430
12년 전 조회 1,092
12년 전 조회 1,568
12년 전 조회 2,282
12년 전 조회 1,564
12년 전 조회 1,456
12년 전 조회 1,980
12년 전 조회 1.5만
12년 전 조회 1,250
12년 전 조회 1,053
12년 전 조회 2,894
12년 전 조회 9,128
12년 전 조회 1,445
12년 전 조회 1,348
12년 전 조회 1,807
12년 전 조회 1,312
12년 전 조회 1,454
12년 전 조회 3,729
12년 전 조회 1,636
12년 전 조회 2,307
12년 전 조회 1,329
12년 전 조회 1,479
12년 전 조회 3,206
12년 전 조회 1,050
12년 전 조회 1,522
12년 전 조회 1,784
12년 전 조회 2,203
12년 전 조회 2,310
12년 전 조회 2,737
12년 전 조회 1,225
12년 전 조회 1,245
12년 전 조회 4,623
12년 전 조회 1,667
12년 전 조회 1,815
12년 전 조회 5,679
12년 전 조회 3,424
12년 전 조회 2,323
12년 전 조회 1,470
12년 전 조회 3,658
12년 전 조회 2,682
12년 전 조회 2,398
12년 전 조회 2,018
12년 전 조회 1,706
12년 전 조회 1,711
12년 전 조회 1,463
12년 전 조회 2,572
12년 전 조회 1,856
12년 전 조회 1,529
12년 전 조회 2,615
12년 전 조회 1,777
12년 전 조회 2,411
12년 전 조회 3,628
12년 전 조회 1,412
12년 전 조회 2,376
12년 전 조회 1,224
12년 전 조회 1,707
12년 전 조회 2,287
12년 전 조회 1,923
12년 전 조회 4,742
12년 전 조회 2,840
12년 전 조회 3,016
12년 전 조회 1,382
12년 전 조회 8,714
12년 전 조회 3,520
12년 전 조회 1,609
12년 전 조회 1,465
12년 전 조회 2,860
12년 전 조회 5,541
12년 전 조회 3,597
12년 전 조회 1,516
12년 전 조회 1.4만
12년 전 조회 1,385
12년 전 조회 789
12년 전 조회 4,107
12년 전 조회 1,607
12년 전 조회 9,505
12년 전 조회 971
12년 전 조회 1,412
12년 전 조회 3,393
12년 전 조회 1,023
12년 전 조회 1,934
12년 전 조회 3,833
12년 전 조회 1,242
12년 전 조회 1,150
🐛 버그신고