17488 Posts in 4473 Topics by 1978 members
| Go to End | ||
| Author | Topic: | 2884 Views |
-
Re: Stop people copying photos off site

29 August 2008 at 12:14pm
Well you best to explain GD then wikipedia - http://en.wikipedia.org/wiki/GD_Graphics_Library. But put simply its a way of editing / creating / tweaking images from your code.
The silverstripe installer checks for GD2 when you install so unless you had an error when you installed you should be fine.
- Fuzz10 as to how to implement it is how your method was written. Does it save a copy of the image some where or just override the original? And also how are you uploading the images? Do you want to add the water mark to the images in the content area or are you using an upload form?. The best way would probably be to define doPublish() on your page class. and have something like
class Page extends SiteTree {
....
...
// this fires when you hit publish
function doPublish() {
$this->AddWaterMarksToImages();
return parent::doPublish()
}
So when you publish a page it runs off and does your water marking method. -
Re: Stop people copying photos off site

29 August 2008 at 6:40pm
Thanks for your reply.
The problem I´m having has more to do with the fact that I cannot figure out how to use the PHP GD library to work the imagedata contained in the silverstripe image. In order for me to watermark the image , I need to be able to get the raw (GD) data out of the Silverstripe object, change it , and then place it back .. Right ?
-
Re: Stop people copying photos off site

29 August 2008 at 6:49pm
check out the http://api.silverstripe.com/sapphire/filesystem/GD.html class. you could create a new GD object with the filename as the constructor and knock yourself out
| 2884 Views | ||
| Go to Top |


