Welcome Guest, Not a member yet? Register   Sign In
URGENT: Watermarking images not working
#1

[eluser]@li[/eluser]
I'm trying to use the codeigniter image manipulation class to watermark uploaded images. What I want to do is have the logo image of the site watermarked to the bottom right of the image. This is what my config array looks like: (output of a print_r)


Code:
(

    [source_image] => /home/xx/xxx/xxxx/upload/5ea4f1a7c980e1ce8fa58c989337c674.jpg
    [new_image] => /home/xx/xxx/xxxx/upload/w_5ea4f1a7c980e1ce8fa58c989337c674.jpg
    [wm_type] => overlay
    [wm_overlay_path] => /home/xx/xxx/yyy/images/appmark.png
)

My code is:
Code:
$this->image_lib->initialize($config);
if (! $this->image_lib->watermark())
{
    echo $this->image_lib->display_errors();
    return false;
}

When I run this, no errors are created. A file 'w_5ea4f1a7c980e1ce8fa58c989337c674.jpg' is created in the location I want, however it doesn't contain the watermark image on it, and is simply a carbon copy of the source_image. What can I be doing wrong?

Any help with this would be very appreciated!
#2

[eluser]bigtony[/eluser]
You could see if the watermark() method returns true or false, and use the image_lib->display_errors() function to see what might be happening. Probably either not finding the path to your watermark image or maybe it's not supporting PNG format.
#3

[eluser]@li[/eluser]
I fixed the issue. For anyone else who comes across this, i had to set the wm_hor_alignment and wm_vrt_alignment options which made it work.




Theme © iAndrew 2016 - Forum software by © MyBB