Skip to content

Instantly share code, notes, and snippets.

@ggarnier
Created December 10, 2010 13:34
Show Gist options
  • Save ggarnier/736201 to your computer and use it in GitHub Desktop.
Save ggarnier/736201 to your computer and use it in GitHub Desktop.
Batch conversion from tga to jpg
#!/bin/bash
# Batch conversion from tga to jpg
# Author: Guilherme Garnier - http://blog.guilhermegarnier.com
# Adapted from:
# http://linux.strangegamer.com/index.php?title=Converting_A_directory_of_TGA%27s_To_JPG
# http://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for img in `ls *.tga`
do
convert $img ${img/.tga/.jpg}
done
IFS=$SAVEIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment