묻고답하기

간단하게 워터마크를 찍을려고 하는대

회원정보를 받아서 찍을려고 합니다.그런대 DB에서 받으면 그냥은 보이지만 CTRl+C,CTRl+V할 경우 찍힌 원터마크가 안보이내요.

<?
/******************************************************************************
Program: watermark-text.php
Copyright (c) 2008 sonosini All rights reserved.
Do not remove this notice
- 사용법 -
<img src='maketext.php?photo=1.jpg'>
******************************************************************************/
  

   

<?
include_once("./_common.php");


                                
   $font_size_auto = true;                        
   $font_size ='40';                               
   $color = '#ffffff';                            
   $drop_shadow = true;                            
   $shadow_color = '#606060';                     
   $angle=40;                                      
   $quality=190;                                  
   $font = 'malgunbd.ttf';                           
   $transparency =90;                             
   $logo_location = 'center';                     
   $offset_x=-420;                                  
   $offset_x1=-820;
   $offset_x2=-1220;
   $offset_y=10;                                   
   $SourceImage = $_GET['photo'];
   $id = get_text($member[mb_id]);
   $WaterMarkText = $id;

   //--------------------------------------------------------------------------------------

   $img_name=explode('/',$SourceImage);
   $img_name_right = sizeof($img_name) - 1;
   $img_name=explode('.',$img_name[$img_name_right]);
   //$WaterMarkedImage =$img_name[0].'_marked.'.$img_name[1];//$this_skin.'/watermark_temp/'.$img_name[0].'_marked.'.$img_name[1];


   list($width, $height) = getimagesize($SourceImage);
   $image_ct = imagecreatetruecolor($width, $height);
   if($img_name[1] == "gif")  $image = imagecreatefromgif($SourceImage);
   if($img_name[1] == "jpg" or $img_name[1] == "jpeg") $image = imagecreatefromjpeg($SourceImage); 
   if($img_name[1] == "png")  $image = imagecreatefrompng($SourceImage); 
   if (!$image) die();

 
   imagecopyresampled($image_ct, $image, 0, 0, 0, 0, $width, $height, $width, $height);
  
   $color = sscanf($color, '#%2x%2x%2x');
   $color_r = $color[0];
   $color_g = $color[1];
   $color_b = $color[2];
 
   if ($font_size_auto) {
        if ($font_size == ''){
          if ($width <= '150px') $font_size = 0;
          elseif ($width <= '250px') $font_size = 9;
          elseif ($width <= '450px') $font_size = 10;
          elseif ($width <= '550px') $font_size = 11;
          elseif ($width <= '650px') $font_size = 12;
          elseif ($width <= '750px') $font_size = 14;
          elseif ($width <= '850px') $font_size = 15;
          elseif ($width <= '980px') $font_size = 16;
          else $font_size = 17;
         }
   }

   $WaterMarkText= iconv("EUC-KR","UTF-8" ,$WaterMarkText);
   $ttfsize = imagettfbbox($font_size, $angle, $font, $WaterMarkText);
   $ttfx = $offset_x + max($ttfsize[0],$ttfsize[2],$ttfsize[4],$ttfsize[6]);
   $ttfx1 = $offset_x1 + max($ttfsize[0],$ttfsize[2],$ttfsize[4],$ttfsize[6]);
   $ttfx2 = $offset_x2 + max($ttfsize[0],$ttfsize[2],$ttfsize[4],$ttfsize[6]);
   $ttfy = $offset_y + max($ttfsize[1],$ttfsize[3],$ttfsize[5],$ttfsize[7]);

   if ($logo_location == 'top_l') {$x=4; $y=$ttfy + 11; $s_x=5; $s_y=$ttfy + 12;}
   if ($logo_location == 'top_r') {$x=$width - $ttfx - 4; $y=$ttfy + 11; $s_x=$width - $ttfx - 5; $s_y=$ttfy + 12;}
   if ($logo_location == 'center') {$x=($width - $ttfx - 2)/2; $y=($height - $ttfy - 2)/2; $s_x=($width - $ttfx - 3)/2; $s_y=($height - $ttfy - 3)/2;}
   if ($logo_location == 'center') {$x1=($width - $ttfx1 - 2)/2; $y=($height - $ttfy - 2)/2; $s_x1=($width - $ttfx1 - 3)/2; $s_y=($height - $ttfy - 3)/2;}
   if ($logo_location == 'center') {$x2=($width - $ttfx2 - 2)/2; $y=($height - $ttfy - 2)/2; $s_x2=($width - $ttfx2 - 3)/2; $s_y=($height - $ttfy - 3)/2;}
   if ($logo_location == 'bottom_l') {$x= 2; $y=$height - $ttfy - 2; $s_x= 3; $s_y=$height - $ttfy - 3;}
   if ($logo_location == 'bottom_r') {$x=$width - $ttfx - 2; $y=$height - $ttfy - 2; $s_x=$width - $ttfx -3; $s_y=$height - $ttfy - 3;}


  
   if ($drop_shadow) {
      $scolor = sscanf($shadow_color, '#%2x%2x%2x');
      $scolor_r = $scolor[0];
      $scolor_g = $scolor[1];
      $scolor_b = $scolor[2];
  
   $color = imagecolorallocatealpha($image_ct, $scolor_r, $scolor_g, $scolor_b, $transparency);
  }
 

  for($i=$font_size+280; $i<=$height-$font_size-50; $i+=$font_size+160) {
 $text_pos_y = $i;
 
  imagettftext($image_ct, $font_size,$angle,$x,$text_pos_y, $color, $font, $WaterMarkText);
  imagettftext($image_ct, $font_size,$angle,$x1,$text_pos_y, $color, $font, $WaterMarkText);
  imagettftext($image_ct, $font_size,$angle,$x2,$text_pos_y, $color, $font, $WaterMarkText);
   }
 
   
   $color = imagecolorallocatealpha($image_ct, $color_r, $color_g, $color_b, $transparency);
  
   imagettftext($image_ct, $font_size,$angle,$s_x,$s_y, $color, $font, $WaterMarkText);

  
   if($img_name[1] == "gif") header("Content-Type: image/gif"); 
   if($img_name[1] == "jpg" or $img_name[1] == "jpeg") header("Content-Type: image/jpeg");
   if($img_name[1] == "png") header("Content-Type: image/png");
   imagejpeg ($image_ct, null, $quality);
 

   imagedestroy($image);
   imagedestroy($image_ct);

?>

 

저기서 $WaterMarkText = $id;부분이 가지고오는것대

$WaterMarkText = 'test'라고 하면 또 보입니다.

 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
Rpgman 음음.. html 태그 제한...  
문성훈 [포토샵 초보질문]하얀색이 없습니다....????(?) 황당..-_-a [7] file 2007.08.10
고경찬 흠? myadmin 의 인증부분에서..  
문주랑 좀 도와 주세요...프레임에 관한 내용 [1] 2007.08.10
문주랑 로그인에 대하여 질문입니다. [2] 2007.08.10
김정현 ExoBUD™ MP v3.3plus <<< 이거 설치하는 방법과 웹에 적용하는 방법 좀 갈켜 주세요... [5] 2007.08.10
편현장 FTP프로그램에서 리눅스 쉘 명령어는 어떻게 쓰지요? ㅡ.ㅡㅋ [3] 2007.08.10
최훈규 include에 관한 질문 [6] 2007.08.10
유지호 styx 스킨의 버튼을 제작하는 방법은 없을까요? [2] 2007.08.10
권성국 글자를 클릭하면.. 새창을 뜨게 하고 싶은데... [1] 2007.08.10
조은애 아이프레임에 관한 질문이요~ [1] 2007.08.10
김미현 제컴이 이상해요. [1] 2007.08.10
CSY 웹캐스팅에 관한 질문.. [1] 2007.08.10
최오규 채널 소스에 대한 질문.. [1] 2007.08.10
ⓔⓤⓝⓐ 제로보드쓰려면 mssql은 안되나요?? [5] 2007.08.10
비즈 트래픽 [3] 2007.08.10
그나 오에카키 게시판이 x로 뜨는데요 ; [3] 2007.08.10
다카노 목록 아래부분에 표시될 페이지의 갯수수정법; [2] 2007.08.10
윤준영 게시판 내용 읽었을때만 메뉴가 깨져서 나오네요.. [1] 2007.08.10
구광서 깔끔하게 표를 그리려면 어떻게 해야하죠? [3] 2007.08.10
네오미 mysql 쿼리 갯수 지정하는 방법좀... ㅡ.ㅡ; [1] 2007.08.10
서태영 [re] 이게 골치가 아픕니다.. [1] 2007.08.10
서태영 이게 골치가 아픕니다.. [1] file 2007.08.10
kadarica 이 소스의 if문에서 요류가 나는 이유 아시는분...ㅠ.ㅠ [9] 2007.08.10
하휴 노프레임시 제로카운터  
박지인 이미지맵 사용 시 새창뜨기。 [2] 2007.08.10
☆좀비파우더™ 자바 애플릿으로 쪽지 실시간으로 보내는 방법점... [1] 2007.08.10
문주랑 다시글을 올립니다.로그인에 관하여............많은 답변좀... [1] 2007.08.10
메딕!! 죄송하지만... 몇가지 구합니다.....^^;; [3] 2007.08.10
이주니 프레임이 맘디루 갈라져요..ㅜㅜ [3] 2007.08.10