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:

<?php
    include_once( 'class/class.upload.php' );
    if(isset($_POST['upload'])){
        $filname=$_FILES['file_name'];
        $handle = new upload($filname);
        $handle->allowed = array('image/*');
        if($handle->uploaded){
            $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
            $handle->process('uploads/');
            if ($handle->processed) {

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





?>

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, networking, learning, and sharing knowledge.