watermarking images with convert

Posted in Bash on September 30th, 2006 by gmunteanu

convert is a command line tool from image magick package

This is a script I use for watermarking the images:

#!/bin/sh
for i in $( ls | grep jpg); do
convert $i -font /usr/share/fonts/Plazan.ttf -pointsize 17 -draw "gravity SouthWest translate 12,-10 fill '#ECD6B1'text 1,11 'MY LOGO' " -draw "gravity SouthWest translate 0,0 image Over 0,0 0,0 '/images/logocompany.png' " $i
done

I place it inside the folder with the images the are to be marked and run it.

How to count the number of lines

Posted in Bash on September 21st, 2006 by gmunteanu

The number of lines in a file
wc -l filename
If you have many files in a folder and you want to count all lines in all files you do:
cat ./*.* | wc -l
or just the log files:
cat ./*.log | wc -l