The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security Checklist
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 37 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Protecting images
PostPosted: Wed Dec 28, 2005 3:06 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Sep 26, 2005 9:04 pm
Posts: 5
Is there anyway to get Joomla to prevent people from stealing images from the site? Is there a something in the system setting or maybe an addon. I need this to meet some legal requirements for my site http://www.cdnpapermoney.com/cpm.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Wed Dec 28, 2005 8:29 pm 
User avatar
Joomla! Master
Joomla! Master
Online

Joined: Thu Aug 18, 2005 7:13 am
Posts: 16285
What do you mean with stealing, just saving images that are shown on your site?

_________________
Joomla forum global moderator.

Take care


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Wed Dec 28, 2005 10:55 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Oct 21, 2005 3:21 am
Posts: 7
Location: Florida
The only image protection mechanism I've seen is through .htaccess and mod_rewrite, but this only prevents other sites from linking directly to them.

A quick Google searched yielded this result:
http://www.webmasterworld.com/forum10/3272.htm

I would be wary of using mod_rewrite, test your site from many machines, I had some problems with it but didn't really play with it for too long.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Thu Dec 29, 2005 2:08 am 
Joomla! Explorer
Joomla! Explorer

Joined: Fri Aug 26, 2005 7:10 pm
Posts: 341
I remember seeing a site that implemented a javascript rollover as some type of image protection.  You can code this up such that when the user's mouse is hovering over an image, the image is replaced with another (perhaps a blank image).  Then, if the user right-clicks (or control-clicks) they receive an option to download and save the replacement image.  I think it was some kind of site that sold posters.

The weakness in this technique is that their images were in a simple directory that could be seen on the source code.  For instance, the right-click method did not allow a visitor to save the desired image, but by looking at the source code for the page and then placing the entire address to the specific image one could download it.  In this situation, the image would be loaded into the browser by itself without the protecting javascript code.  Basically, this might help you a little, but it only provides security against those who don't know anything about source code.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Fri Dec 30, 2005 12:27 pm 
If you are on a *nix based server using cPanel, you should have access to "Hotlink Protection".  The hotlink "blurb" in cPanel says this:
Quote:
HotLink protection prevents other websites from directly linking to files (as specified below) on your website. Other sites will still be able to link to any file type that you don't specify below (ie. html files). An example of hotlinking would be using a tag to display an image from your site from somewhere else on the net. The end result is that the other site is stealing your bandwidth. You should ensure that all sites that you wish to allow direct links from are in the list below. This system attempts add all sites it knows you own to the list, however you may need to add others.


This has worked a charm for me for years now.

I've also been known, when finding an image I knew was mine to rename the image for my site, then load a new one with the old name, and the new image had "Dirty bandwidth thief" in red letters on black background on it.  If after a request they haven't stopped, you do the switch, and watch how long it takes for them to stop stealing that image :)  Bit childish, but efficient ;)


Top
  
 
 Post subject: Re: Protecting images
PostPosted: Sun Jan 01, 2006 8:04 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Aug 18, 2005 12:22 pm
Posts: 960
Location: Ballarat, Australia
vavroom love your sense of humour ... simple and great strategy

Must move on that

_________________
We cannot become what we need to be ... by remaining what we are


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Mon Jan 02, 2006 3:29 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Sep 26, 2005 9:04 pm
Posts: 5
Thanks everyone.

Yes, I'm trying to prevent people from "right clicking" and saving files to their hard drive. I've used a Javascript on the old site that prevents the "right click" from working and it even prevents the images from downloading into the users cache. This way the images cannot be accessed by anyone's local computer (in this case, to make counterfeit banknotes). I didn't think my images where scanned at enough resolution to be a problem, until the police showed me a counterfeit note that had been passed with my watermark one it.  :-[

I've use the "Hotlink Protection" and that seems to work, but it's not the complete solution to protecting the images, I need to keep them off of local drives entirely.  :'(

And since I'm just a "power abuser", not a coder, I need easy to implement solutions. I'll keep looking, but thanks for the pointers.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Mon Jan 02, 2006 3:46 am 
Joomla! Explorer
Joomla! Explorer

Joined: Fri Aug 26, 2005 7:10 pm
Posts: 341
I wonder... is there a way you can overlay a transparent image on top of the main image?  Then, if someone passes over your other right-click protection, they are still only saving the transparent image.  Maybe another implementation is to ignore the image input via Joomla and use some type of javascript reference so that your source directories are not so easily found.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Mon Jan 02, 2006 3:52 am 
I've never been too worried about lifting my images with a right click.  Oh, yes, it's bothersome, and can be downright agravating.  I know someone who saw their entire site be "lifted", image and all, and reused.  But if someone's determined enough to get your stuff, they will..

javascript protection from right-click is nice, but...  only requires someone to disabled javascript and the image becomes available again ;)  Not worth the bother in my book.

I'm much more worried about bandwidth, where someone stealing an image from your site and uses it as an avatar on an active forum, for example, can see your bandwidth go up in leaps and bounds...

Cheers


Top
  
 
 Post subject: Re: Protecting images
PostPosted: Mon Jan 02, 2006 4:08 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Sep 26, 2005 9:04 pm
Posts: 5
I like the "transparent image" idea. I'll have to think about that one, though the underlay image would still be in the cache...

As for linking, the problem isn't bandwidth, it counterfeiting. With the RCMP and the Bank of Canada breathing down my neck and wanting to close down the site, I've got to find a way to protecting the images and plastering a huge ugly watermark on them all is not very attractive. Now, if there where an automatic way to apply the watermark on the fly...

ah, but back to reality.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Mon Jan 02, 2006 4:57 am 
CdnPaperMoney wrote:
As for linking, the problem isn't bandwidth, it counterfeiting. With the RCMP and the Bank of Canada breathing down my neck and wanting to close down the site, I've got to find a way to protecting the images and plastering a huge ugly watermark on them all is not very attractive.


Ahhh, yes, I've just gone to the site now and see your problem...  Sorry, don't have a solution :(


Top
  
 
 Post subject: Re: Protecting images
PostPosted: Tue Jan 03, 2006 11:33 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jan 03, 2006 10:41 pm
Posts: 11
Have you had a look at Amazon.com they have used some fancy way of showing excerpts from books so that they can't be copied/saved.  I think it only worked with IE though.  Probably used ActiveX or some such.  I'm not an expert on those type of things.  All I know is that it always annoyed me as I use Opera (or Firefox if I'm desperate) but could only see the pages at work with IE.

Still as most people use IE it would be better than nothing (or a visit to the local prison) for you I suppose.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Wed Jan 04, 2006 4:55 am 
User avatar
Joomla! Champion
Joomla! Champion

Joined: Thu Aug 18, 2005 2:09 am
Posts: 5154
Location: California
Amazon uses the transparent image method along with some javascript.
In IE it is easily defeated by first opening a new window (control-N) and then looking at the source.
Various Firefox extensions may do the same thing.

The hardest ones to grab are buried in multiple Flash file links along with javascript links.
Good site mirror software will follow all these Flash and javascript links and download the images.

And you can always screen grab it.

I cannot see how anything but watermarking will satisfy the regulators.
Exactly what have they requested?

_________________
██ AllMedia4Joomla Project
██ http://sourceforge.net/projects/allmedia4joomla/
██ AllMedia YouTube Feed Gallery module released
██ Download: http://sourceforge.net/projects/allmedia4joomla/files/


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Wed Jan 04, 2006 4:57 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Aug 18, 2005 12:22 pm
Posts: 960
Location: Ballarat, Australia
Try this

Required ... PHP 4+ and GD 2.0+

A file you call 'watermark.png' should be located in the same directory as the code (below). If not, change the file path in the following code, which will load the watermark image. The file should be a PNG-8 format file, not PNG-24.

Make the watermark.png say whatever you like on it our you could use a semi opaque/ opaque copyright symbol

Code:
<?php 

header('content-type: image/jpeg'); 

$watermark = imagecreatefrompng('watermark.png'); 
$watermark_width = imagesx($watermark); 
$watermark_height = imagesy($watermark); 
$image = imagecreatetruecolor($watermark_width, $watermark_height); 
$image = imagecreatefromjpeg($_GET['src']); 
$size = getimagesize($_GET['src']); 
$dest_x = $size[0] - $watermark_width - 5; 
$dest_y = $size[1] - $watermark_height - 5; 
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); 
imagejpeg($image); 
imagedestroy($image); 
imagedestroy($watermark); 

?>


See how you go with that?  ;)

_________________
We cannot become what we need to be ... by remaining what we are


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Sun Jan 15, 2006 3:57 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jan 14, 2006 3:44 pm
Posts: 6
hmm maybe You could say where to put it in the joomla code? thanks


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Sun Jan 15, 2006 11:57 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Aug 18, 2005 12:22 pm
Posts: 960
Location: Ballarat, Australia
Oops  :-[

In your template index.php

_________________
We cannot become what we need to be ... by remaining what we are


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Tue Jan 17, 2006 9:13 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Aug 12, 2005 1:58 am
Posts: 895
Location: Perth - Western Australia
I've yet to find a mechanism that stops people from simply saving the page (in doing so all images are saved) or alternatively simply doing a screen print which essentially produces the same result.

Personally I gave up trying... but would be interested if there is something out there I don't know about.

Cheers
Shayne

_________________
http://www.cloudum.com Perth's Joomla! Development
http://www.nooku.org Home of Nooku Framework (koowa) the RAD development framework for Joomla!.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Tue Jan 17, 2006 9:32 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Aug 18, 2005 12:22 pm
Posts: 960
Location: Ballarat, Australia
I agree Shayne but at least a water mark makes life difficult when  people try that.

The other thing is if the iamges are of insufficient quality then no body will bother.

_________________
We cannot become what we need to be ... by remaining what we are


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Tue Jan 17, 2006 9:36 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jan 17, 2006 9:10 am
Posts: 6
CdnPaperMoney,

It is very difficult to pretect your images. The best protection is not to put them online.  ???

If you want some first line protection, use this code in the head section of your page:

Code:
<meta http-equiv="imagetoolbar" content="no">


This prevents to show the small toolbar on your images in IE.

CU
Karel


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Sat Jan 21, 2006 11:32 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Oct 24, 2005 2:45 pm
Posts: 9
Location: Lansing Illinois
Never tried this and I assume you could not then use zoom gallery. Counterfitters are normally lazy, maybe you clould slice you images into multiple uneven pieces and put it in a table. Could turn out to be more work that they are willing to do to put them back together. Many counterfitters use photo-copies and plain images and use the most basic of image editors and printers. 

Regards,

Lance

_________________
Almost always, the hardest thing to do and the right thing to do are are the same thing.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Sun Apr 22, 2007 12:06 am 
Joomla! Intern
Joomla! Intern

Joined: Wed Sep 13, 2006 3:18 pm
Posts: 79
yerg wrote:
Try this

Required ... PHP 4+ and GD 2.0+

A file you call 'watermark.png' should be located in the same directory as the code (below). If not, change the file path in the following code, which will load the watermark image. The file should be a PNG-8 format file, not PNG-24.

Make the watermark.png say whatever you like on it our you could use a semi opaque/ opaque copyright symbol

Code:
<?php 

header('content-type: image/jpeg'); 

$watermark = imagecreatefrompng('watermark.png'); 
$watermark_width = imagesx($watermark); 
$watermark_height = imagesy($watermark); 
$image = imagecreatetruecolor($watermark_width, $watermark_height); 
$image = imagecreatefromjpeg($_GET['src']); 
$size = getimagesize($_GET['src']); 
$dest_x = $size[0] - $watermark_width - 5; 
$dest_y = $size[1] - $watermark_height - 5; 
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); 
imagejpeg($image); 
imagedestroy($image); 
imagedestroy($watermark); 

?>


See how you go with that?  ;)


Would it be possible to use a variation of this to make a php coded version of the blank.gif image protection method? I have code for doing it with tables and with divs, but seeing as how the images I need to protect are being served up by virtuemart, I need a php coded version of the method. Been searching high and low for a way to do this, have tried countless diffferent attempts myself, and have failed every try:( So if this can somehow be manipulated into a php version of the blank image over laying the real image in the background method of image protection, I would love to know!

Thank you,
David Henderson

_________________
Thanks,
David Henderson


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Wed Aug 29, 2007 3:09 pm 
Joomla! Intern
Joomla! Intern

Joined: Tue Dec 20, 2005 11:52 am
Posts: 50
Sorry, old thread I know... someone mentioned overlaying a transparent gif.

Would it be possible to write a system mambot or something that adds this for all images OR, replaces all img tags with div tags, setting the image as the background using CSS (perhaps with a transparent gif inside the div)?

I know it's not foolproof but every deterrent helps.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Thu Aug 30, 2007 11:57 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Aug 18, 2005 6:43 pm
Posts: 110
Watermarking is now very easy in rsgallery. You can set transparancy and size. Works like a charm.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Thu Aug 30, 2007 12:59 pm 
Joomla! Intern
Joomla! Intern

Joined: Tue Dec 20, 2005 11:52 am
Posts: 50
We've used watermarking on some sites and it does work very nicely. The problem is with the client's logo which cannot be watermarked for obvious reasons.

I'm hoping it's possible to use a mambot (like the email protection one) to convert/protect all images automatically... particularly ones that aren't being managed by a gallery system. A really clever mambot could have configuration options to add a watermark to all content images and to add a watermark to non-content images (like a logo) if the referrer doesn't match the site or is blank.


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Thu Aug 30, 2007 5:16 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sat Feb 11, 2006 9:43 pm
Posts: 292
Location: Birmingham, USA
I have used the following script, that upon right click, opens  popup with your indicated size , text ...ect. But this does not stop the skilled image grabbers. If someone wants to get an image, they will get that image regardless what you put there.

Code:
// Script Source: CodeLifter.com

// Copyright 2003

// Do not remove this header.



// ----------- Setups ------------------

// Set the address, width, height, top

// and left dimensions for the popup

// window below.

// -------------------------------------



PopUpURL    = "http://www.yourdomain.com/your_warning_page.html";

PopUpLeft   =  100;

PopUpTop    =  100;

PopUpWidth  =  500;

PopUpHeight =  100;



// -------------------------------------

// Do not edit anything below this line.

// -------------------------------------



isIE=document.all;

isNN=!document.all&&document.getElementById;

isN4=document.layers;

popO='left='+PopUpLeft+',top='+PopUpTop+',width='+PopUpWidth+',height='+PopUpHeight



if (isIE||isNN){

document.oncontextmenu=checkV;

}else{

document.captureEvents(Event.MOUSEDOWN || Event.MOUSEUP);

document.onmousedown=checkV;}



function checkV(e){

if (isN4){

if (e.which==2||e.which==3){

dPUW=window.open(PopUpURL,'nrc',popO);

return false;

}}else{

dPUW=window.open(PopUpURL,'nrc',popO);

return false;}}


_________________
The key to your life is how well you deal with plan "B".
Latvian Project http://joomlacode.org/gf/project/joomla_latvian/ | http://www.joomlalv.org


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Wed Nov 05, 2008 3:51 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Jan 18, 2007 10:40 pm
Posts: 10
Come on ppl you cant tell me no-one has made a plug in for this!

i need that as well seeing a client of mine has an e-shop with a lot of product images that need to be protected!

_________________
will design for code!:

http://www.alfonsscholing.com


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Sun Nov 09, 2008 1:03 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Thu Aug 18, 2005 12:22 pm
Posts: 960
Location: Ballarat, Australia
grafisch I think you are wishing on a star here ... if I want to grab an image I will

I'm thinking your only option is to visibly water mark each image as some of the commercial image sites do.

Remember this isn't a Joomla issue it's a web issue

_________________
We cannot become what we need to be ... by remaining what we are


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Tue Aug 04, 2009 9:21 pm 
Joomla! Intern
Joomla! Intern

Joined: Wed Apr 26, 2006 10:48 pm
Posts: 50
I just tried using the code and all i got was a heap of errors at the top of the page.
I put a watermark.png image in the template folder.


Code:
<?php

header('content-type: image/jpeg');

$watermark = imagecreatefrompng('watermark.png');
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);
$image = imagecreatetruecolor($watermark_width, $watermark_height);
$image = imagecreatefromjpeg($_GET['src']);
$size = getimagesize($_GET['src']);
$dest_x = $size[0] - $watermark_width - 5;
$dest_y = $size[1] - $watermark_height - 5;
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100);
imagejpeg($image);
imagedestroy($image);
imagedestroy($watermark);

?>




Warning: imagecreatefrompng(watermark.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory in /home/......./index.php on line 102

Warning: imagesx(): supplied argument is not a valid Image resource in /home/....../index.php on line 103

Warning: imagesy(): supplied argument is not a valid Image resource in /......./index.php on line 104

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/......./index.php on line 105

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: Filename cannot be empty in /home/......./index.php on line 106

Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/...../index.php on line 107

Warning: imagecopymerge(): supplied argument is not a valid Image resource in /home/..../index.php on line 110

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/....../index.php on line 111

Warning: imagedestroy(): supplied argument is not a valid Image resource in /...../index.php on line 112

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/....../index.php on line 113


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Fri Jan 21, 2011 4:57 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Nov 07, 2008 12:51 pm
Posts: 189
i would like to know aswell.. been looking for it for while. A customer asked me about this feature and i said as someone posted if you want to show and someone can see it they can grab it no matter what you do. For him its more of the designs he dont want anyone to copy..


Top
 Profile  
 
 Post subject: Re: Protecting images
PostPosted: Fri Jan 21, 2011 8:38 pm 
User avatar
Joomla! Master
Joomla! Master
Online

Joined: Mon Mar 20, 2006 1:56 am
Posts: 11634
Location: The Girly Side of Joomla in Sussex
Akarr wrote:
For him its more of the designs he dont want anyone to copy..
if you can see the image, you can grab it. put copyright watermarks on it.

_________________
HU2HY- Poor questions = Poor answer
Un requested Help PM's will be added to the foe list and possibly just deleted
{Community.Connect Administrator }{ Showcase & Security Moderator}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page 1, 2  Next



Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group