Page 1 of 1

Image watermark class/function

Posted: Mon Aug 29, 2011 11:30 pm
by DomC
First off,
I don't think you have made this yet but if you have sorry.

I was wondering if you could create a class or function which adds a predifined watermark to an image that is passed to it.
I hope you understand what I mean but if not I'll try and rephrase it.
What do you think?
Dom

Re: Image watermark class/function

Posted: Tue Aug 30, 2011 7:38 am
by bowersbros
http://betterphp.co.uk/board/viewtopic.php?f=23&t=29

The code for what you want is there, if you want it explained just ask which parts you don't understand and ill try my best to explain it :)

Re: Image watermark class/function

Posted: Tue Aug 30, 2011 8:20 am
by DomC
Oops - thanks a lot, I'll check it out

Re: Image watermark class/function

Posted: Tue Aug 30, 2011 11:13 am
by jacek
I might do this anyway, it would be pretty easy :D

Re: Image watermark class/function

Posted: Tue Aug 30, 2011 1:38 pm
by DomC
Ah cool
I am looking forward to it, if you do decide to go ahead and do it.

Re: Image watermark class/function

Posted: Tue Aug 30, 2011 8:07 pm
by DomC
You made it! Thanks a lot - I'm off to watch them

Re: Image watermark class/function

Posted: Tue Aug 30, 2011 11:05 pm
by jacek
DomC wrote:You made it! Thanks a lot - I'm off to watch them
I did :D

Not exactly a watermark but the principle is the same.

Re: Image watermark class/function

Posted: Wed Aug 31, 2011 7:57 pm
by bowersbros
all thats needed to make it a true watermark is a transparent image (GIF or PNG)

So.. i'd call it a watermark if im honest :P

Re: Image watermark class/function

Posted: Wed Aug 31, 2011 8:01 pm
by DomC
I'd agree and just move the image to centre or bottom of the picture and Voila!

Re: Image watermark class/function

Posted: Wed Aug 31, 2011 8:03 pm
by jacek
DomC wrote:I'd agree and just move the image to centre or bottom of the picture and Voila!
Centre or bottom require knowing the width and height of the main image, which is why I did top left :D

Re: Image watermark class/function

Posted: Wed Aug 31, 2011 8:06 pm
by bowersbros
jacek wrote:
DomC wrote:I'd agree and just move the image to centre or bottom of the picture and Voila!
Centre or bottom require knowing the width and height of the main image, which is why I did top left :D
Or you could tile it ;)

Re: Image watermark class/function

Posted: Wed Aug 31, 2011 8:17 pm
by DomC
bowersbros wrote:
jacek wrote:
DomC wrote:I'd agree and just move the image to centre or bottom of the picture and Voila!
Centre or bottom require knowing the width and height of the main image, which is why I did top left :D
Or you could tile it ;)
Good point - I did not think of that! I'll have to play around with it when I get back home on Friday!