Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-11-15 08:52:27

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

copyprotection of images

client wants to protect its photos on a site for downloading/saving. what are the best, the easiest ways to do that? what you suggest?

Offline

#2 2013-11-15 09:49:53

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: copyprotection of images

found this javascript from here

<script type="text/javascript">

<!-- Disable  
function disableselect(e){  
return false  
}  

function reEnable(){  
return true  
}  

//if IE4+  
document.onselectstart=new Function ("return false")  
document.oncontextmenu=new Function ("return false")  
//if NS6  
if (window.sidebar){  
document.onmousedown=disableselect  
document.onclick=reEnable  
}  
//-->  
</script>

it disables right click on whole page, but i would prefer to disable right click only on photos. could anybody help me here?

Last edited by Gallex (2013-11-15 09:56:48)

Offline

#3 2013-11-15 09:58:45

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: copyprotection of images

Hi Gallex, there is no way to protect as any javascript disabled browser would easily bypass any restriction – not to mention that anyone could take a screenshot. I was given some good advice – by Jukka if I remember correctly – somewhere in this forum: “If you don’t want it to be copied, don’t put it on the net”.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2013-11-15 10:20:35

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: copyprotection of images

colak wrote:

Hi Gallex, there is no way to protect as any javascript disabled browser would easily bypass any restriction – not to mention that anyone could take a screenshot.. I was given some good advice – by Jukka if I remember correctly – somewhere in this forum: “If you don’t want it to be copied, don’t put it on the net”.

this is not an opion ;)
and i know there is no bullet-proof solutions. but most of visitors are not so clever. and just …to make it little bit uncomfortable for copiers

Offline

#5 2013-11-15 10:28:58

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: copyprotection of images

Is watermarking the photos an option?

The problem with disabling right-clicking and contextual menus is that it stops users from doing legitimate tasks that require that functionality, e.g. opening links in a new tab/window. In my opinion the negative impact on usability and user experience for all users of such things is likely to much more harmful to a business than that suffered from the minority of visitors that will attempt to steal photos for their own use.

Let’s face it, you can’t stop someone from viewing source and directly opening the images in their own windows without any of the accompanying HTML or javascript.

As Colak rightly says, don’t put anything online that you aren’t happy being in the public domain.

Offline

#6 2013-11-15 11:29:16

trenc
Plugin Author
From: Malmö
Registered: 2008-02-27
Posts: 572
Website GitHub

Re: copyprotection of images

If you can see the image in the browser you had it already downloaded (copied). It’s essential.

The only thing you can do is teaching your client how the »internet« is working.

Last edited by trenc (2013-11-15 11:33:05)

Offline

#7 2013-11-15 11:51:30

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: copyprotection of images

guys, i know all that and i have been counted on it .
but still, could anybody write to me modified code from my previous post? disabling right click only on photos

Offline

#8 2013-11-15 12:04:00

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: copyprotection of images

A quick Google gives me these options:

Plus this article from Sitepoint that your client really ought to read!

Offline

#9 2013-11-15 12:06:58

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: copyprotection of images

You can offer the normal click experience when you layer a transparent one-pixel-gif on top of the image you want protected and stretch the gif to take the underlying image’s dimensions.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#10 2013-11-15 14:26:42

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: copyprotection of images

CSS pointer-events: none; is a nice alternative in modern browsers, but it will disable left clicks too.

Offline

#11 2013-11-16 07:55:00

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: copyprotection of images

On a recent project, TXP based, I use a transparent gif above all images positioning with CSS (which is a better solution than some javascript) in order to protect drag & drop effects. This kind of method is used by flikr, too.
For better protection, all images are created with a watermark on the fly. See in action here
If you’re interested, send me an email.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#12 2013-11-16 18:14:12

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: copyprotection of images

uli wrote:

You can offer the normal click experience when you layer a transparent one-pixel-gif on top of the image you want protected and stretch the gif to take the underlying image’s dimensions.

^^ This. Also, make a div the same size as the image, set the image as the background and stretch a 1px transparent GIF over it if you want to be sneaky.

Of course, any browser inspector will see the background image loaded and the URL will be visible. This can also be used to find the source files on streaming media sites, if that’s something that interests you.

Offline

Board footer

Powered by FluxBB