Page 1 of 1

Php God(s)

Posted: Thu Feb 10, 2005 1:26 am
by us3rX
*From Chat:
[19:42] [T] ~Adaera : can php do watermarking overlay?
[19:43] [T] +Josh` : not sure, ask jer
[19:43] [T] +Josh` : lol
[19:43] [T] +Josh` : I would think so
[19:43] [T] +Josh` : since it can put text on an image
[19:44] [T] ~Adaera : k, cuz I don\'t want ppl to be able to just take our images from the online store
[19:44] [T] ~Adaera : even if they do a ss, they\'ll get a watermark over it
[19:44] [T] &redrum[]work[] : but you don\'t want to have to watermark every one <img src=\'http://www.killanet.net/forum3/public/s ... >/blum.gif\' class=\'bbc_emoticon\' alt=\':P\' />
[19:44] [T] ~Adaera : and I don\'t want to have to actually...zactly lol
[19:45] [T] ~Adaera : I want thumbnails & watermarks on the fly

So i looked and found

[code]<?php
$WaterMark_Transparency = "50";

$WaterMark = imageCreateFromGIF("wm.gif");
$Main_Image = imageCreateFromPNG("us3rx-sig.png");
 
$Main_Image_width = imageSX($Main_Image);
$Main_Image_height = imageSY($Main_Image);
$WaterMark_width = imageSX($WaterMark);
$WaterMark_height = imageSY($WaterMark);

$MaterMark_x = ($Main_Image_width - $WaterMark_width);
$MaterMark_y = ($Main_Image_height - $WaterMark_height);
 
imageCopyMerge($Main_Image, $WaterMark, $MaterMark_x, $MaterMark_y, 0, 0, $WaterMark_width, $WaterMark_height, $WaterMark_Transparency);

header("Content-Type: image/PNG");

ImagePNG ($Main_Image);
?>[/code]
[url=\"http://us3rX.killagraphix.com/image.php\"]Example[/url]

Is there anyway this can be \"edited\" to make it do what ada wants?

us3rX <img src=\'http://www.killanet.net/forum3/public/s ... /ph34r.gif\' class=\'bbc_emoticon\' alt=\':ph34r:\' />

Php God(s)

Posted: Thu Feb 10, 2005 3:10 am
by Josh
ummm yeah..I guess? I don\'t get the whole idea of this image store thing so that information would help too lol.. Is it cafepress? :\

Php God(s)

Posted: Thu Feb 10, 2005 3:24 am
by us3rX
i think like ada is talking about pictures that are going to be \"Prints\" only

us3rX <img src=\'http://www.killanet.net/forum3/public/s ... /ph34r.gif\' class=\'bbc_emoticon\' alt=\':ph34r:\' />

Php God(s)

Posted: Thu Feb 10, 2005 3:29 am
by Tami
We don\'t have a cafepress store, haven\'t for some time. We will have prints & stock photos. I don\'t want ppl getting the good images for free, hence thumbnails & watermarks on the fly cuz I ain\'t watermarking every one of them individually.

Php God(s)

Posted: Thu Feb 10, 2005 3:47 am
by Josh
lol..well.... I suppose you can make a script which reads all files in a directory (so you\'d be adding all the images in a directory) and it could generate an image when you do some php gets to do things.. It\'s sort of hard to explain. I know how you could do it I just don\'t know the backend coding. I guess tomorrow (When I\'m not half drousy & sleepy) I could explain it to one of our site coders. I\'m sure they\'d know how to do it though ..... but I\'ll do my best at explaining this:

1.) Make a PHP Script file which will read all images in the current folder
2.) Have that script grab an image specified and make it into a $variable..
3.) Make the watermark image a $variable too.. you could put the watermark in the root file.
4.) Now here is where I don\'t know how you\'d go about doing it... In the php file which shows the image and stuff somehow (I guess include();) get the coding from that php script and it will generate the image..

Make sense? No? I\'ll explain further if you want me to.

Php God(s)

Posted: Thu Feb 10, 2005 1:05 pm
by Scott
Yes its possible <img src=\'http://www.killanet.net/forum3/public/s ... /smile.gif\' class=\'bbc_emoticon\' alt=\':)\' />