0

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>';





?>
2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by Squidge
1

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.

Edited by Squidge

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.