Advanced search  

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]

Pages: [1] 2 3   Go Down

Author Topic: Anti-Copy Mod : Complete Image Overlay, Hide Image Links, and other features...  (Read 50852 times)

0 Members and 1 Guest are viewing this topic.

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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)
« Last Edit: August 18, 2007, 10:02:38 am by GauGau »
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website

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
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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.
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website

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

(http://www.pftq.com/gallery/albums/uploads/yosemite/thumb_DSC01767.JPG)

(http://www.pftq.com/gallery/albums/uploads/yosemite/normal_DSC01767.JPG)

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

PYAP
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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)
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website

Hum,
(http://www.pftq.com/gallery/albums/uploads/independance%20day/thumb_DSC01494.JPG)
I try just at this minute !
(http://www.pftq.com/gallery/albums/art/pftq/thumb_random.png)
It's the same for full size pix and intermediate
.
PYAP
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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?
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

@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.

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.
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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).
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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. :)
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

Can you try now? Do you get a replaced url to a blank image file instead?
Yes, works as expected now.

It'd be great if you can attach the source again thanks.
See attachment

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.
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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.
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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.
Logged

lifter

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 37
Re: Anti-Copy Mod : Complete Image Overlay, Hide Image Links, and other features
« Reply #17 on: September 08, 2007, 04:27:18 am »

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  :-\
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Anti-Copy Mod : Complete Image Overlay, Hide Image Links, and other features
« Reply #18 on: September 08, 2007, 10:34:39 am »

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
Logged

pftq

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 111

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).
Logged
Pages: [1] 2 3   Go Up
 

Page created in 0.114 seconds with 19 queries.