谷歌图表API生成的二维码可以添加水印吗
是否可以使用jquery或cakephp为googlecharts api生成的二维码添加水印。
我很感激任何帮助。
谢谢。
Is it possible to add watermark to QR code generated by google charts api using jquery or cakephp.
I appreciate any help.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我想唯一的方法是将谷歌图表生成的图像保存在您的服务器上,然后添加水印 vi GD 或 imagemagick。
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.
我不会在二维码上加水印。相反,我可能会以某种方式在 QR 码中编码的数据上添加水印。
例如,如果您正在对 URL 进行编码,您是否可以将 URL 从“http://example.com/foo”更改为“http://example.com/foo?watermark-referrer=www-你的域名-com-什么”?然后仍然会显示该二维码是您的,但您不必冒损坏二维码图像本身的风险。
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.
jQuery 选项是仅将水印图像放置在 Google Charts 制作的图像之上,但原始图像仍然可用。
PHP选项是通过curl请求生成QR图像,读取位图数据,通过GD或ImageMagick处理它,然后将其保存在某个地方并显示它。
不过,水印可能会干扰扫描算法,尤其是在使用不良相机读取时。
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.