Anti-Copy Mod : Complete Image Overlay, Hide Image Links, and other features... Anti-Copy Mod : Complete Image Overlay, Hide Image Links, and other features...
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Anti-Copy Mod : Complete Image Overlay, Hide Image Links, and other features...

Started by pftq, August 03, 2007, 12:54:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pftq

I made this a while back for my own gallery.  So far it prevents copying as far as I know without using brute force and digging through cache or screenshoting the browser.  I thought I might share and perhaps someone may help improve it as well.

Although it does exactly what I intended it to do, I cannot call it an actual plugin or add-on.  The install is a bit lousy I admit. :P Sadly it modifies to coppermine files.  To use it, you must include either the code or the file containing the code, into your theme file.  I haven't really had a chance to look into how to make it a plugin, but more or less I'd like to not have to be able to modify the following files, but just overwrite the script/functions:

profile.php - for the thumbnails
/include/slideshow.inc.php - the whole script


Nonetheless it works great - been using it for a month myself.  Hopefully it helps a few others out there as well. :)

Coppermine Anti-Copy Mod

Here it is working on my own site: Gallery

Currently I have the following set up on the mod:
- Basic Protection: Overlay a blank image over all pictures (prevent right-click copying)

- Hiding Links: Pass all picture addresses through an image-generating file:
--* Requires random code from server to generate an image.
----* Random code generated from timestamp + offset from any resource of your choosing
--* Optional caption on generated images.
--* Optional resizing on the fly.
--* Image-generator and its features usable independently from mod and gallery (see CUSTOMIZATION)

- For those with Apache: Deny access to files
--* Deny direct access to all image files (specify types in .htaccess file)
--* Forward those who find the images to a page of your choice.
--* Allow you to rename the image-generating file to any name and extension.

- Copying Permissions: Specify specific users and groups to allow copying
--* Enter the user id # or group name into the Gallery Description or Album Password Hint
--* Seperate with commas, no spaces (unless part of group name)
--* Place a negative in front to deny. ex -1, -banned
--* Denying has priority over allowing.
--* Optional removal of caption for those allowed to copy, see CUSTOMIZATION

- Extra features I added to my own gallery and am too lazy to undo:
--* Categories with no visible albums (to the user) and no thumbnail/description become hidden from view.
--* Videos default to 640x480 dimensions
--* Non-image files can now use custom intermediate images if uploaded (default normal_ prefix)

Pascal YAP

Hey pftq,

Sorry but my Firefox 2.0.0.6 can copy all your pix  ;)

In IE 7.x, Full size pix did'nt show nothing (red cross) !  ???

PYAP

pftq

Hmm IE 7 shows the picture fine over here... Could you try again? Maybe the server just died for the moment. lol


Yeah, I'm aware FF can save backgrounds (it was a problem before) but I believed I fixed that.  Are you using right-click or digging into cache? :P

pftq

Ok I just tried with FF 2.0.0.6 and I can't right-click for the picture.... Hmm can you double check? I might have been changing the script around and testing it on my site at the time.

Pascal YAP

With Firefox 2.0.06, Right click and "Copy Img URL":

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.pftq.com%2Fgallery%2Falbums%2Fuploads%2Fyosemite%2Fthumb_DSC01767.JPG&hash=c5f6552a2919c8a37713e4369beaf09f246b141e)

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.pftq.com%2Fgallery%2Falbums%2Fuploads%2Fyosemite%2Fnormal_DSC01767.JPG&hash=9d0cdc791a78b07af72f6f7f8406504eafadb23b)

Full size pix URL :
http://www.pftq.com/gallery/albums/uploads/yosemite/DSC01767.JPG

PYAP

pftq

I cannot find that url anywhere in the source. ??? lol I think you may have accessed it the same time I was editing the gallery (hence the mod was down).  I will leave my gallery be for the next 2 hours or so.  :P

The good news I guess is that the link does not work.

Maybe I missed it but what page did you find the url on? (all urls should be hidden to some extent)

Pascal YAP

Hum,
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.pftq.com%2Fgallery%2Falbums%2Fuploads%2Findependance%2520day%2Fthumb_DSC01494.JPG&hash=6033f65e5b2c40f33d0a918786aec040cb0b5685)
I try just at this minute !
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.pftq.com%2Fgallery%2Falbums%2Fart%2Fpftq%2Fthumb_random.png&hash=132b6f99e5b41ebf947d5646cfe741cc242b9226)
It's the same for full size pix and intermediate
.
PYAP

pftq

Bah.. I don't quite get it.  I can't even find those urls in the page source... (the site should be serving to a different file).  Are you sure you refreshed? Do you think could perhaps save the page source and send it to me?

pftq

Or actually attach the text file here - seeing as we're allowed to.

Joachim Müller

@pftq: thanks for your contribution, but I'm afraid that this mod will need some more tweaking. I'm looking forward to see this fully functional.

Quote from: PYAP on August 03, 2007, 10:47:01 PM
With Firefox 2.0.06, Right click and "Copy Img URL":
Confirming Pascal's test (using FF2).

@all: warning - this mod is a resource hog. If you apply it, you better prepare having to talk to your webhost pretty soon for extraordinary resources consumption.

pftq

Thanks for the confirmation but I'm unable to reproduce the result here.  ??? Using the latest FF2 as well.  When I right-click copy Image or URL, I only get the blank image.

Could you please attach the page html code in a text file? The URLs you guys have given me should not exist at all so I'm curious (PHP is serverside so I'm not sure why FF makes a difference).

Joachim Müller


pftq

Aha I see now.  The language setting you have messed up the mod a bit.  (I used a search expression only for A-Za-z0-9).  Thanks - that's exactly what I needed to know. :)

pftq

Can you try now? Do you get a replaced url to a blank image file instead? It'd be great if you can attach the source again thanks.

I've changed the regex expression so it looks for the end bracket > instead of looking for possible contents of the tag (didn't consider other language characters before).

By the way - how does coppermine check the language if I may ask? Changing the language setting on the browser does not seem to affect the gallery language.

Joachim Müller

Quote from: pftq on August 17, 2007, 11:08:13 AM
Can you try now? Do you get a replaced url to a blank image file instead?
Yes, works as expected now.

Quote from: pftq on August 17, 2007, 11:08:13 AMIt'd be great if you can attach the source again thanks.
See attachment

Quote from: pftq on August 17, 2007, 11:08:13 AM
By the way - how does coppermine check the language if I may ask? Changing the language setting on the browser does not seem to affect the gallery language.
3-step fallback mechanism, explained at http://coppermine-gallery.net/demo/cpg14x/custom_language.php or http://documentation.coppermine-gallery.net/languages.htm#how
Delete all files but english.php from the lang folder if you want to get rid of other languages entirely.

pftq

Ah ok.  Well thanks.  Glad it works now - hopefully will figure something about the resource consumption in the near future.  Not sure what's up with that but I will take a look when I have time.

pftq

Well, I've been searching a bit.  Maybe someone can clue me in but as far as I've been able to find, image functions in PHP take up lots of resource regardless what you code.  The only way I see to avoid resource consumption would be to remove serving images thru PHP (and thus, "unhiding" the URLs from the page source).  If there are any requests for removing it, I can make it optional.  Otherwise, there doesn't appear to be any other way.

lifter

I would like to install this mod, but I can't risk it being a resource hog because I plan on having a ton of connections to my site at once  :-\

Joachim Müller

There's no risk: as with all mods, you're suppossed to perform a backup of your files before you start modifying them. This being said: apply the mod - if it later turns out that it is consuming to many resources, you can savely undo it.
In fact we would welcome to see this mod applied on a busy site: your feedback (as the owner of a busy site with this mod applied) would be very welcome. After all, my remark on the mod being a resource hog is based on viewing the code, but not on actual experience with it. Therefor, a "live report" would come handy.

If you decide to apply the mod and give us your feedback, your report should include:
  • a link to your gallery
  • a non-admin test user account if needed to access your page
  • Some stats about your daily average traffic and the peeks
  • Details about the server resources

pftq

Yes as always, back up your site.  Unfortunately, I was not able to find any other way to achieve this without using a high number of resources.  Apparently from what I've read and tried, using any PHP image functions will use a lot of memory (depending on the size of the image).

I could create a version without using image functions but then all you'd have is the transparent gif overlay.  A mod that does that already exists if I recall correctly (search transparent here).