Combining 2 scripts - Upload + Watermark

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
blade_922
Forum Contributor
Posts: 132
Joined: Wed Jul 12, 2006 4:57 pm

Combining 2 scripts - Upload + Watermark

Post 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.
Last edited by blade_922 on Sun Sep 09, 2007 6:43 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

So loop over the images as they're handled during the upload process adding the watermark.
blade_922
Forum Contributor
Posts: 132
Joined: Wed Jul 12, 2006 4:57 pm

Post 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.
Last edited by blade_922 on Mon Sep 10, 2007 1:51 am, edited 1 time in total.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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).
(#10850)
Post Reply