Is it possible to ad开发者_运维知识库d watermark to QR code generated by google charts api using jquery or cakephp.
I appreciate any help.
Thanks.
I guess the only way to do that is saving the image generated by google charts on your server, and then add the watermark vi GD or imagemagick.
I wouldn't watermark a QR code. Instead, I'd probably watermark the data I was encoding in the QR code in some way.
For example, if you're encoding a URL, could you, for example, change the URL from "http://example.com/foo" to "http://example.com/foo?watermark-referrer=www-yourdomain-com-whatever"? Then there's still an indication that the QR code is yours, but you don't have to risk breaking the QR image itself.
A jQuery option is to just place a watermark image on top of the one that Google Charts makes, but the original will still be available.
A PHP option is generate the QR image via a curl request, read the bitmap data in, muck with it via GD or ImageMagick, then save it somewhere and display it.
The watermark may interfere with a scanning algorithm, though, especially when read with a bad camera.
I think you should test the QR code with watermark, because there is a big chance that lots of reader won't recognize.
精彩评论