Closed daniel-berger-nemeth closed 9 years ago
Sorry but, can you describe your problem? If you're using a watermark with a black background there's no issue here.
I understand that your png file is transparent and, when applying the watermark, it turns black. Is this right?
Yes, this is right. Both should be transparent after the watermark.
I'll try to fix it then.
It seems that when I made Watimage I didn't expected gif images to be used as watermarks, instead, the code is built just for using png images as watermark.
I'll try to work on it during these days. Theoretically the imagecopyresampled
used in the internal method resize_png_image
(which will be renamed, as it names clearly states that it's just for png images) does not maintain the alpha for gif images. Instead I'll need to use imagecopyresized
method.
This stackoverflow answer saved me a lot of time. :smile: Now I expect the theory to be possible... :sweat_smile:
HHhmmm... after testing it by myself I can only see the script failing when using gif images as background (if those images have alpha they loose it) but watermarking gif files with png does not negatively affect the watermark.
Are you sure that the image that gains a black background is the png image? Isn't it the gif image used as backgruond?
Here are my tests using gif images as background...
As you can see, the watermark image doesn't loose it's transparency, whilst the gif image used as background does.
I've also tested any other circumstance (using always gif or png files for watermarks) and there are no more failures, so I'll try to fix this issues.
If i try to watermark an gif image with a png watermark file, the gif is transparent, but the png watermark has a black background.