singapore: the smallest big galery
home » forum » Mods » Watermarking

You are not logged in.

#16 2006-03-26 23:01:32

Lemmontree
Member

Re: Watermarking

and where d i h to put the call stuff?

$image = markImage ($image, 'me')
$thumb = sgThumbnail::markImage ($thumb,'(c) Joe Bloggs');

Offline

 

#17 2006-03-27 22:19:17

Paul
Member

Re: Watermarking

Lemmontree, you could comment out the few lines beginning with the comment

Code:

 //if thumbnail is newer than image then output cached thumbnail and exit

in thumb.php. I think that should make your thumbnail anew every time.

As for the call to the function, you could put it in the same place, just under where it sets the image interlacing (search the file for 'ImageInterlace'. It's line 167 in my copy of the file.

Offline

 

#18 2006-03-27 22:20:30

Paul
Member

Re: Watermarking

Thanks, Gary, that's very swish smile

Offline

 

#19 2006-09-03 08:42:54

Kuker
Member

Re: Watermarking

anyone got the watermarking working with png images and not just text strings?

Offline

 

#20 2006-12-12 17:10:29

gmarblestone
Member

Re: Watermarking

Yes i have it with gif files
its almost the same as above you only need to change the function.

I am NOT a php programmer so there is a better way to do the stuff i have done.  Its hard coded...!!! beware

Just add this below markImage and change your call to markImage2.  Thats all.

Code:

function markImage2($image)
{
    // this script creates a watermarked image from an image file - can be a .jpg .gif or .png file
    // where watermark.gif is a mostly transparent gif image with the watermark - goes in the same directory as this script
    // where this script is named watermark.php
    // call this script with an image tag
    $imagewidth = imagesx($image);
    $imageheight = imagesy($image);

    if( $imagewidth < 150 )
    {
        $watermark = @imagecreatefromgif('watermarksmall.gif');
    }
    else
    {
        $watermark = @imagecreatefromgif('watermark.gif');
    }

    $watermarkwidth = imagesx($watermark);
    $watermarkheight = imagesy($watermark);


    //$watermarkwidth = imagewidth/;
    //$watermarkheight = imageheight/10;

    //$startwidth = (($imagewidth - $watermarkwidth)/2);
    //$startheight = (($imageheight - $watermarkheight)/2);
    $startwidth = $imagewidth - $watermarkwidth - 10;
    $startheight = $imageheight - $watermarkheight - 10;
    imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight);
    return $image;
}//markImage2

Offline

 

#21 2006-12-12 17:12:09

gmarblestone
Member

Re: Watermarking

Anyone know how to make it work for the large images? to force a draw?

Offline

 

#22 2006-12-12 17:47:06

Paul
Member

Re: Watermarking

? What do you mean?

Offline

 

#23 2007-03-01 00:48:35

chuck
Member

Re: Watermarking

has anyone gotten either Gary's or Lemontree's posts to work?   If you have can you please share what changes you made and how did you do the call and where?

Offline