Register
It is currently Tue Oct 21, 2014 7:37 pm

bbatxt - Writes text to all .jpg images.


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Fri Feb 06, 2009 6:06 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Code:
#!/bin/bash
# FILE : bbatxt
# Function: Writes text to all .jpg images in the directory.
# Copyright (C) 2006-2009 Dave Crouse <crouse@usalug.net>
# ------------------------------------------------------------------------ #
if [[ $1 = "--help" || $1 = "-h" || $1 = "help" ]]; then
        echo "          Function: Writes text to all .jpg images in the directory.";
        echo "          Usage: $0 \"comment inside of quotation marks ! \" ";
        echo "          Requires: wrjpgcom";
        echo "          EXAMPLE: $0 \"My comment goes here\" ";
        echo "          Note, you MUST include the quotation marks around the comment";
        echo "          or the command will fail to perform as expected.";
        echo "          ";
        echo "          Comments/Suggestions/Bugfixes to <crouse@usalug.net>";
        echo "          USA Linux Users Group - http://usalug.org";
        echo "          ";
exit 0
fi

if [[ -z $( type -p wrjpgcom ) ]]; then echo -e "The program wrjpgcom -- NOT INSTALLED !";exit ;fi

if [ -z "$1" ] ; then
        echo " ";
        echo "          ######### COMMAND FAILED ########## ";
        echo "          USAGE: $0 \"comment inside of quotation marks ! \" ";
        echo "          EXAMPLE: $0 \"My comment goes here\" ";
        echo "          Note, you MUST include the quotation marks around the comment";
        echo "          or the command will fail to perform as expected.";
        echo "          ######### COMMAND FAILED ########## ";echo " ";
else

comment=$1
comment=" $comment "

labelimage ()
{
convert ${i:2} \
-fill white -box '#00000080' \
-gravity South -font Helvetica-Bold \
-pointsize 15 \
-annotate +0+5 \
"$comment" \
_${i:2}
}

export IFS=$'\n';
for i in $(find . -maxdepth 1 -type f -iname "*.jpg");
do
labelimage; mv _${i:2} ${i:2}; echo "Adding text to" ${i:2};
done
fi
exit 0


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP