2

Can you disable right-click and image dragging in Galleria?

The images on my site are to be sold commercially and we therefore want to stop people from pinching them without paying!

If it can't be done in Galleria, any ideas how to achieve it in Javascript or jQuery?

Si

Simon S
  • 217
  • 6
  • 17

4 Answers4

4

Can you disable right-click and image dragging in Galleria?

Yes. You can cancel default methods of contextmenu and dragstart. You can also place a transparent element over the image to block click events. See below.

The images on my site are to be sold commercially and we therefore want to stop people from pinching them without paying!

You can not stop people from getting images you place on your website. Once the user has viewed the image, it is already on their hard drive.

If it can't be done in Galleria, any ideas how to achieve it in Javascript or jQuery?

The best you can do is watermark them in a way that would take a long time to remove/hide.

alex
  • 479,566
  • 201
  • 878
  • 984
  • 1
    Or provide lower quality versions. Sell the high resolution and care less about 800px wide versions. – Quentin May 23 '11 at 10:11
  • 1
    Thanks - I am aware of the caching issue, as well as the ability for someone to go into the source, find the image and browse directly to the image in a browser. Figured that the vast majority of users would not know about these methods and would therefore buy them legitimately. I am already dynamically resizing and watermarking the images in PHP. Thanks for the pointers on contextmenu and dragstart. Will take a closer look at this. – Simon S May 23 '11 at 12:05
1

This works for me. (make sure you have jQuery)

// Disable right click & drag copy in Galleria
$('#galleria').bind('contextmenu', function(e){
    return false;
});

$('#galleria').bind('dragstart', function(e){
    return false;
});
Perception
  • 79,279
  • 19
  • 185
  • 195
jtlai
  • 779
  • 7
  • 7
1

As already said : it's not possible.
You can try googleing for a script that auto-resize-crop images (PHP). by doing so the images provided will be low resolution.
than you can create over all images a div with a transparent background.
Doing so any right click will actually save the 10x10 transparent .png

Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313
0

It will be still possible to download the images anyway (Firefox => Tools => Page info).

ncla
  • 803
  • 9
  • 22