Page 1 of 1

Combining 2 scripts - Upload + Watermark

Posted: Sun Sep 09, 2007 6:39 pm
by blade_922
Hello,

I have 2 scripts. One uploads images and then once uploaded it shows the images and a link next to the uploaded images to watermark the image.

So heres is what i usually do,

Say i upload 5 images, once uploaded, it shows the 5 image names that i just uploaded, and then next to them has a link which when clicked, watermarks the image.

The link is like this:

Code: Select all

http://www.mysite.com/administrator/make.php?image=images/uploads/20070910_hcvsfncmuz.jpg&watermark=1
What would i have to do to automatically watermark the images when uploaded instead of doing it after upload individually.

Posted: Sun Sep 09, 2007 6:42 pm
by feyd
So loop over the images as they're handled during the upload process adding the watermark.

Posted: Sun Sep 09, 2007 6:52 pm
by blade_922
Cheers Feyd.
Im always making mistakes when writing loops as such.

Here is my current code it shows the submit buttom and the uploading process AND also below that it also shows what comes up AFTER upload where the page shows all the uploaded image names where i can click them individually to watermark them.

Im not sure how to loop what im trying to do because theres loads of images.

Posted: Sun Sep 09, 2007 8:08 pm
by Christopher
Somewhere in you upload script to replace the move_uploaded_file() call with the code that does your watermarking. You could make the watermarking based on a parameter you pass, so it would either just use move_uploaded_file() or watermark it and then copy (as in the code above).