All,
I'm no programmer at all but I do like to try and stop people "taking" on the fly my pictures by the simple "right click - save as". To help deter people from doing this I typically (before using Gallery) added the following Java script (as a side file) and this helps to act as a deterent. I know people could still use screen captute but with the high resolution ones that would make things a lot hard.
Are there any Gallery2 programmers out there willing to do this (or something better if you know of one) as a mod (similiar set up to the incredible Add to Cart / Paypal / Buy Button). I know it's not perfect but every little bit helps.
Many Thanks
Nigel.
(This should be the one thing the user can change during setup.)
var message="I'm sorry, The Right click option on your mouse has been disabled for the download window pages. All images on this page are Copyright Nigel Aves - 2005. Please send me email of the picture name and reason for use and I will probably email you back the high quality version.";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
Posts: 383
Well, do the following:
That disables the right click without the message (I hate the message; do you have any idea how often people accidentally right click and have to put up with some message?). You can always insert your code there if you really really really want to.
[lol]By the way, the safest way of disabling people to get your copyrighted stuff is to not put it online ;)[/lol]
Posts: 32509
Nigel_Aves,
see:
http://codex.gallery2.org/index.php/Gallery2:UserContributions#Mods.2FPatches
especially:
http://gallery.menalto.com/node/35398
Posts: 61
RwD,
I tried this tonight and no matter what, I could not get it to work (I'm using the "Matrix" theme). I even tried copying those lines of java directly into photo.tpl (no local directory) with no success. I checked all the the way down to ensure that Matrix was the theme. Any ideas?
Valient,
I looked at the Patches you suggested and it was a tad over my head. It looked like it was changing one of the "master files" and to be honest I don't like doing that as it is probably beyond my cut and paste scope!
Many thanks to you both ....
Nigel.
Posts: 383
I have no idea which browser you are using. This works for both of the browsers I can test with; IE6 and FF1.0.6.
The top of my photo.tpl when I test this looks like this:
You should check your browser to see which broser you are using and verify you altered a file called "gallery2/themes/matrix/templates/local/photo.tpl"
ps
Older brosers might require the language attribute inside the script element:
<script language="javascript" type="text/javascript">
Posts: 32
a couple of ideas explored earlyer [even tho this won't stop people from just grabbing the image from the browser cache]:
* add another layer, containing a transparent 1x1px gif stretched to the same size as the real image, above the image.
* to attemt to remove the image from cache, you could modify apache to set the image non-cachable (usually used for images from webcams and such).
Posts: 3236
Another option is a good watermark, IMHO this is the best option. You still have the issue of "view source" pretty much requiring the image path to be there unless you use CSS some how... and then you can view the CSS.
Also, I hate right click disable scripts. I think they suck. I especially hate the ones that pop up a stupid message that says "right click disabled". DUH, thanks I couldn't figure that out on my own. Also, now I can't use any of my favorite right click options like open in new window... so instead of bothering with your "protected" site I just close it.
Disabling right click only stops the most retarded of "image thiefs" but it pisses off everyone that visits your site. Just say no to disabling right click and use something more sophisticated like a watermark that advertises for your site instead!
Like Gallery? Appreciate my help? Think I'm an asshole? Make your point by donating to the Gallery project! Or maybe just visit my website.
Posts: 61
Rwd,
Using the latest Explorer, Firefox and Mozilla for testing. No matter what I tried (and I did excatly the same as you suggested) it did not work.
I am using "watermarking" so maybe I'll stick with that but I did not want to put the watermark right in the middle of the image (that annoys me as much as "fryfrogs" announcement at disabling right click.)
gilrim,
I'll have a look at this idea over the weekend, sounds interesting. Also, providing disabling cache only works with images then that will not hurt performance to much as the only images needed to be re-loaded would be the thumbnails.
fryfrog,
You'd be surprised how many can not work out that right click has been disabled. I used to have no message and actually recieved emails from people asking why they could not save my images because they had tried on a number of images! So I added the message, emailed one of the original complainers and they wrote thanking me saying that at least now they understood! LOL ... goes to prove that "you can not please all the etc etc ........."
All,
What is so F^%$ed up about it all is that the real problem here are the browser developers. On one hand you have the mighty MicroSofty yelling and screaming about digitial rights and copyrighted material, lets become a bum buddy with Sony to stop illegal downloading of music and video and on and on ... and then they produce browsers that allow saving and printing right in their own interfaces. Now that is the Duhhhhhhhhh. General rule of thumb on the internet is that all images are copyrighted unless explicitly stated.
The whole thing should have been reversed ages ago where I could add a line of code to the html to allow downloading! It's like the tele-marketers, why did they need a "do not call list", would it not have been better to produce a "please call list" .... Now those scumbags have found away of calling cell phones and making you pay for the entire call! (make sure your cell phones are on the no call list)
Rant Over .... I know this forum should not be for ranting .....
Nigel.
P.S. fryfrog, your no asshole (or as us Brits would say arsehole) ...
Posts: 23
Uhh... I'm sorry, but do you have any idea of how the Internet works?
The whole idea of preventing people from saving things from the Internet is totally flawed: you simply have to make up your mind: either you give people the data or you keep the data for yourself. You cannot do both at the same time!
Don't try to do the impossible, instead add watermarks to your images and serve only middle-sized photos.
Posts: 61
Just amazing how many rude people there are, especially in forums ... shame really.
I'm assuming that "mgeisler" must be one of the bum buddies I mentioned because we all know how well the words security and Microsoft go together, looking back at their last 4 operating systems that I've used. (I missed ME thank God).
Oh well, life goes on, let's not try to fix the problem or even make a start or even have a real discussion, let's just keep our front doors open and let anyone take what they want. That seems to be the general concensus of people who seem to be developers on Gallery (mgeisler and fryfrog).
And before anyone mentions "watermarking" again, I do use them, they work well.
Nigel.
Posts: 23
I didn't mean to be rude, I was just surprised about your statements... First, for once this problem has nothing to do with Microsoft and their lack of security --- here it's really not their fault I use Linux and Firefox myself, so I'm no "bum boddy" with MS.
The problem is that you cannot control what happens with your image data when it has left your server: when it reaches the browser then it's free to do with the data as it sees fit. You can suggest that it does not cache the image, but you cannot force it to obey your request.
That's my point: there can be no "magic keyword" which will force every browser on the planet to deny users when they try to right-click on the image and save it --- I might have written my browser myself and maybe I deliberately designed it not to obey this rule.
I hope you see what I mean now: when the cat (when the image has left your server) is out it's too late to catch it.
Martin Geisler
http://mgeisler.net/
Posts: 61
I nearly did not come back to this topic !!! But let me also appologize I was some what miffed at your statement, especially the internet one
We actually have no disagreements on this. My point is the browser / server development groups have made it dead easy, there is no road block at all. So you have companies like Microsoft who say one thing about music / video (must be protected at all costs and another when it comes to images). Gallery2 has done a good job by hiding the images out of the http path but after the image has been served it all falls down.
If I have time this weekend I'll play around with the idea of layers and using transparent image in front. Should at least keep me out of trouble!
I also need to read up on Apache and cache usage. From what I read last night it does the reverse but I noticed a section on stopping caches being made but I don't think that was on a user level.
Take Care,
Nigel.
Posts: 23
Great! Using whatever tricks you can pull off to (try and) stop people from saving your images is of course your choice --- I just wanted to clear up that those tricks cannot work 100%.
Martin Geisler
http://mgeisler.net/
Posts: 4
this worked great except I put the script into the theme.tpl - is there any reason i would want to put this in the album.tpl? I felt that by placing it the script into the theme.tpl prototection for the whole site would result. Thank you for the help. I also added the META tag to disable IE image toolbar
Posts: 32509
theme.tpl should be fine too.
Posts: 14
By "anywhere to the template" do you mean inside the photo.tpl file I just copied? Not clear on which file you're referring to when you say "template".
For example, for the Matrix template, would I add it to /gallery2/themes/matrix/templates/local/photo.tpl ? Cause it's not working.
Posts: 32
RwD,
I added this to my pages and it works,
but if I want a message how do I add that.
Posts: 21
Works great folks.
Now, might anyone have script to disable drag n drop?
Posts: 46
Hi Derickson,
You can get full script here.
Alex,
Read more about photo sharing.
Posts: 7
<body oncontextmenu="return false;">
this little scripy disables right click and the keyboard
hope it helps
Posts: 2
You and Nigel_Aves crack me up...
Posts: 2
Most sensible post in this whole thread.
Posts: 9
I added the script to photo.tpl and it still doesn't work?
http://www.ultraimagephotography.com.au/gallery/main.php?g2_itemId=4210