Bash Batch Image Processing Script

0 Likes

Actually, it's just a simple (well, somewhat simple) set of bash functions
all put together in one script with a menu (of sorts) to help you work on
batches (entire directories) of images, all at once. I do some web design,
and I like to take digital pictures, and have thousands of them. While
uploading images to some fancy photogallery software is fine for a few
images, I wanted to harness the power of Linux and Imagemagick to create
something that could be run from a command line on images on a server that
didn't use X, and that could run very fast and without interaction if I
wanted it to, or that could accept user input.



Why bash? Well, because I like bash, and am still learning how to use it,
and it seemed like a good idea at the time. So, while I know of other
projects that do this, I don't know of any that use bash. I could be
wrong, there very well could be a bash script that does all this already,
but it's good practical experience anyway. I've seen some that use perl,
some that use c and some that use python, but never anything very large
using bash. Bash comes installed with almost every major Linux system, so
there wouldn't be the need for php, perl, python, or even the use of a
compiler to run it. Just about the only needed application is Imagemagick.
Talk about simple



So basically, it's my project I'm doing to learn more about bash and it's
limits and possibilities. I don't claim it to be great programming, but it
proved useful to me on several occasions, so I thought I'd share it. If
you like the program, great; if not, feel free to suggest things or
comment on it. Development can be tracked at http://bbips.org and
https://sourceforge.net/projects/bbips/

Changelog notes: bbips.0.4.0.sh



  • Major code changes in several functions. Updated version number to .0.4.0


  • YOUR CURRENT WORKING DIRECTORY IS ~~ Made it display bold.


  • Added several functions to allow for spaces in filenames and directories.
    Modified several functions to make use of the command line utilities that
    were added in.


  • Fixed some bash coding to make it a bit more elegant. IMHO (Still needs
    lots of work i know)


  • list_images function changed to list ONLY jpg's or JPG's


  • Removed the zip function.


  • Fixed tar and gzip functions to ONLY include the jpegs.


  • Image Functions now create directories with useful information at the end
    of the directory name, making it easier to keep track of what you did to the images in that
    directory.


  • Fixed bbresize -- removed the -size option... only using -resize now.

Labels:

Collateral
Comment List
Anonymous
Related Discussions
Recommended