如何使我的网页中的图像不可下载 [英] how to make images in my webpages not downloadable

查看:89
本文介绍了如何使我的网页中的图像不可下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何通过右键单击我网页上的图片来防止人们将图片另存为....

I am wondering how to prevent people from Save image as.. by right-click images on my webpages.

我正在考虑禁用右键单击,但似乎我必须编写 javascript 代码.有没有简单的方法来做到这一点?

I was thinking about disable right-click, but it seems I have to write javascript code. Is there a easy way to do this?

推荐答案

简单的答案是你不能那样做".您可能可以在服务器端放置一些东西,以便在提供图像之前检查引用,但即使这样也不能 100% 保证.此外,即使您确实设法阻止了这种情况,也没有什么能阻止某人截取浏览器页面的屏幕截图,然后从中裁剪图像.

The simple answer is "you cannot do that". You might be able to put something on the server side that will check the referer before serving the image, but even that is not 100% guaranteed. Moreover, even if you did manage somehow to prevent this, nothing would prevent somebody from taking a screenshot of the browser page and then cropping the image out of it.

我认为更好的方法是对图像进行服务器端 url 重写和处理,以添加某种可见的水印,以识别您拥有的图像,并在 EXIF 信息中保存适当的版权信息.

I think a much better approach would be to have a server-side url rewriting and processing of the images to add some sort of a visible watermark identifying the images as owned by you and saving a proper copyright information in the EXIF information.

这篇关于如何使我的网页中的图像不可下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆