Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorTextronics
    • CommentTimeDec 21st 2005
     
    I have this script in .php for watermarking my pictures, but can somebody please explain how i implement this???

    (Please in layman very novice terms)

    the link ........

    http://www.sitepoint.com/print/watermark-images-php

    i have also been told that i have to use something call "for loop" instead of ($_GET[ 'src' ] ) ;

    Is this so?

    The code:
    <?php

    header('content-type: image/jpeg');

    $watermark = imagecreatefrompng('watermark.png');
    $watermark_width = imagesx($watermark);
    $watermark_height = imagesy($watermark);
    $image = imagecreatetruecolor($watermark_width, $watermark_height);
    $image = imagecreatefromjpeg($_GET['src']);
    $size = getimagesize($_GET['src']);
    $dest_x = $size[0] - $watermark_width - 5;
    $dest_y = $size[1] - $watermark_height - 5;
    imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100);
    imagejpeg($image);
    imagedestroy($image);
    imagedestroy($watermark);

    ?>

    The gallery i wish the photo's to be watermarked:

    http://www.clairebaluci.com/gallery

    Many thanks in advance.
    • CommentAuthorTextronics
    • CommentTimeDec 21st 2005 edited
     
    I re - uped the photos with the watermark on the pictures themself .... seemed like a quicker option.

    I used a progrm called "REAWATERMARK". Good piece of software for this job.
    • CommentAuthorddejong
    • CommentTimeDec 21st 2005 edited
     
    Go here instead:
    http://www.plogger.org/forum/comments.php?DiscussionID=189&page=1
    Plogger uses an image manipulation library called phpThumb. phpThumb supports watermarking already.

    Cheers,
    Derek
  1.  
    I agree and seen it, but I could not find any instructions on how to use it !!
    • CommentAuthorddejong
    • CommentTimeJan 5th 2006
     
    in plog-functions.php, line 79, add:
    if ($thumb_config['filename_prefix'] != '') {
    $phpThumb->fltr = array("wmi|images/watermark.png|BR|20|5"); }

    And put your watermark file in /images, called "watermark.png". (Because phpThumb & GD2+ supports transparency.)

    Cheers,
    Derek
    •  
      CommentAuthormike
    • CommentTimeJan 5th 2006
     
    Don't forget to delete all the thumbnails in your /thumbs/ directory so they are forced to regenerate.
  2.  
    many thanks for the explaination