-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot add watermark to GIF images #49
Comments
Hi @russellseymour, a GIF is a compilation of multiple images. GD doesn't manage GIF (in fact GD only use the first image of a GIF), but I created a class (https://github.com/Sybio/GifFrameExtractor) to recover all images of a GIF that you can watermarked separately and another class (https://github.com/Sybio/GifCreator) to rebuild the GIF with watermarked frames. Please note it can rarely display graphic bug depending on the GIF encoding... Find the tutorial here : http://phpimageworkshop.com/tutorial/5/manage-animated-gif-with-imageworkshop.html |
Hello @Sybio, Thanks very much for this. I have now refactored by code to use these two classes when working with GIF files. However the class throws an error when I attempt to extract the frames from the GIF as it states that it is not animated. This is the case, there is only one image in the GIF file, but I had assumed that there would be at least one frame in there for it to work with. So although I have got a better understanding of how it should work I am still not able to add a watermark to the gif image. Thanks, Russell |
If this is a one frame GIF, it should work without the 2 additionnal libs. This is perhaps a bug... Can I have a look to your original code and can you share me images you're using ? |
Yep no problem, and thanks very much. The code that I am using is as follows:
The image I am working with is: If I run the above code with the image above, I get the following result: As you can see the original image is not there. I have played around the layer number settings but it has not made a difference. Hopefully you can help me find the error. thanks again, Russell |
Have you had a chance to look at this at all? Thanks, Russell |
Hello,
I have been going through the tutorial about adding watermarks and I seem to have found a problem.
When I attempt to add a watermark to a GIF image I just the text layer with the text on it and no image below that layer. At first I debugged my code but could not find a problem so then I tested with a JPG image and it worked.
So it appears that adding a text layer to a GIF image does not work. Is there something I am missing?
If i do not attempt to add the text layer and just save the image to a different filename then I can see the GIF image properly so it only when the layer is added to I get this issue.
Thanks, Russell
The text was updated successfully, but these errors were encountered: