Running a script

software development

#1

can someone pls help me on watermarking my script?
i will run this on my local computer only.

i already have the script in watermarking my images using imagemagick.

and i have link to watermark one image
http://127.0.0.1/imagemagick.php?cat=category&page=1&fname=1.jpg

i also have the script to generate the links you can see above

what i mean when is that when i click on that link it will generate a particular image. but i dont wanna click 1000’s of links. how can i do it run in just running it once.

thanks in advance


#2

You could do some work on the script code so it selects all images on a directory (let’s say /images) and loop through all of them.

the php function you’re interested in is readdir()
http://cl2.php.net/readdir

now, since your example shows that images are numbered sequentially (1.jpg, 2.jpg… etc) there is a solution which is a bit rougher but still works if you don’t want to mess with readdir (you still have to do a bit of coding though)
note the first and last numbers on the set of images (let’s say they begin at 1.jpg and end at 100.jpg, so you write down 1 and 100)

have the script run within a loop (I suggest you use For) with initial value 1 and upper limit 100. on each instance, have variable fname take the value x.“jpg” (x will cycle from 1 to 100 or whatever upper limit you set) so on each pass the script runs with a different image number

I don’t know if I made myself clear enough, let me know if you could make any sense of my mumbo-jumbo :smiley:

cheers!