Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Stop people copying photos off site

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2
Go to End
Author Topic: 3244 Views
  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Stop people copying photos off site Link to this post

    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.

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Stop people copying photos off site Link to this post

    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 ?

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Stop people copying photos off site Link to this post

    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

    3244 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.