Hi I have created a small program that enables the user to upload a phote and get an email back with a watermark on it.

Now the watermark is places in the bottom border with no margin, so I was wondering if anyone knew how I could make a small margin on the water mark.

Thank you, I hope you understand what I meen.

My code looks like this:

    include_once( 'class/class.upload.php' );
        $handle = new upload($filname);
        $handle->allowed = array('image/*');
            $handle->image_border          = 5;   // defining border width
            $handle->image_border_color    = '#000'; // defining border color
            $handle->image_watermark = 'badge.png';  // watermark image src
            $handle->image_watermark_position = 'BR'; // watermark image position again "BR" for bottom right and so on.
            $handle->image_resize         = true;   // making resize function to true
            $handle->image_x              = 160;    // making width to 160px
            $handle->image_y              = 160;    // making hight to 160px
            if ($handle->processed) {

                //$message = '<div class="center"><p>Border color #F58462 added successfully</p><img src="uploads/'.$handle->file_dst_name.'" alt="" /></div>';


Recommended Answers

All 3 Replies

Looking at the site from where the code comes from : http://www.verot.net/php_class_upload_docs.htm

You could use:

$handle->image_watermark_x = 5; //change to fit your needs
$handle->image_watermark_y = 5; //change to fit your needs

Instead of

$handle->image_watermark_position = 'BR';

Which is a fixed predetermined location.

Yeah thx that worked :D

good to hear, if this thread is now solved please mark it solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.