Watermark with Wideimage With png

Asked

Viewed 388 times

4

I’m trying to add a watermark via php with the library Wideimage.

    include 'WideImage/WideImage.php';
    $img = WideImage::load($targetFile);
    $watermark = WideImage::load('../images/logowater.png');
    $img = $img->merge($watermark, 'right-20','bottom-20', 60);

    $img->saveToFile($targetFile);

$targetFile é o nome do arquivo base

It’s working normally, but if the image is one. png, the mark is applied and the applied image space is all blank, I would need it to be applied png. Is there some trick that went unnoticed?

1 answer

2


Solved,

I applied direct transparency to the image, increasing opacity.

I modified in the mergethe amount of transparency from 60 to 100

$img = $img->merge($watermark, 'right-20','bottom-20', 100);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.