watermark, please help me to add watermark on this programming. please urgent

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    watermark, please help me to add watermark on this programming. please urgent

    please help me to add watermark on images nd thumb
    Attached Files
    Last edited by manavworld; 30.12.12, 17:03.

    #2
    PHP Code:
    <?php
    $font_path 
    "arial.ttf"// path to font file, download one
    $font_size 30/// font size
    $water_mark_text_2 "My Watermark Text"// watermark text

    function watermark_image($oldimage_name$new_image_name)
    {
    global 
    $font_path$font_size$water_mark_text_2;
    list(
    $owidth,$oheight) = getimagesize($oldimage_name);
    $width $height 300
    $image imagecreatetruecolor($width$height);
    $image_src imagecreatefromjpeg($oldimage_name);
    imagecopyresampled($image$image_src0000$width$height$owidth$oheight);
    $blue imagecolorallocate($image79166185);
    imagettftext($image$font_size068190$blue$font_path$water_mark_text_2);
    imagejpeg($image$new_image_name100);
    imagedestroy($image);
    unlink($oldimage_name);
    return 
    true;
    }
    ?>
    to use
    PHP Code:
    <?php
    watermark_image
    ('Path to image to watermark''Path/Name to save the new image as');
    ?>
    Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

    Comment


      #3
      Originally posted by kevk3v View Post
      PHP Code:
      <?php
      $font_path 
      "arial.ttf"// path to font file, download one
      $font_size 30/// font size
      $water_mark_text_2 "My Watermark Text"// watermark text

      function watermark_image($oldimage_name$new_image_name)
      {
      global 
      $font_path$font_size$water_mark_text_2;
      list(
      $owidth,$oheight) = getimagesize($oldimage_name);
      $width $height 300
      $image imagecreatetruecolor($width$height);
      $image_src imagecreatefromjpeg($oldimage_name);
      imagecopyresampled($image$image_src0000$width$height$owidth$oheight);
      $blue imagecolorallocate($image79166185);
      imagettftext($image$font_size068190$blue$font_path$water_mark_text_2);
      imagejpeg($image$new_image_name100);
      imagedestroy($image);
      unlink($oldimage_name);
      return 
      true;
      }
      ?>
      to use
      PHP Code:
      <?php
      watermark_image
      ('Path to image to watermark''Path/Name to save the new image as');
      ?>



      i has post this uploader file. can you please solve this issue with image and thumb, i mean i want to have watermark on main image and thumbs as well.
      Attached Files

      Comment


        #4
        unlink($oldimage_name);
        will delete the old image
        Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

        Comment


          #5
          At first download arial.ttf file n upload where ur php file lies.

          Comment

          Working...
          X