Top Secret Area!!!

Recommended Sites
xgusties.com
craigmile.com
computers

Webcams - Script to make add the date to an image

Use the following bash shell script to add the date to the top of your newly captured webcam images before posting them to the internet. This example uses the pbmplus library.

The Script

date "+%x %X " \
| /usr/X11R6/bin/pbmtext \
| /usr/X11R6/bin/pnmcrop \
| /usr/X11R6/bin/pnmmargin 4 \
| /usr/X11R6/bin/pnmmargin -black 1 \
> /tmp/date.$$.pbm

/usr/X11R6/bin/pnmpaste /tmp/date.$$.pbm 3 264 picture.ppm \
| /usr/bin/cjpeg -quality 80 > picture.jpeg

rm /tmp/date.$$.pbm

Of course you could also use ImageMagick. It is a bit more up to date.

Posted: 29th July 2003