Created
January 26, 2014 16:26
-
-
Save bhcopeland/8635239 to your computer and use it in GitHub Desktop.
Simple script that uses ufraw-batch to convert CR2 (raw) images into JPG.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
###################### | |
##Simple script that uses ufraw-batch to convert CR2 (raw) images into JPG. | |
##Place the script inside /usr/bin/cr2tojpg | |
##Usage: cr2tojpg /your/image/location | |
##Ben Copeland 2014 https://github.com/bhcopeland 26/01/14 | |
####################### | |
cd $1 | |
if [[ -z "$1" ]]; then | |
echo "set a directory" | |
else | |
if [ -d $1 ]; then | |
if [ ! -d ./processed_images ]; then mkdir ./processed_images; fi; | |
# processes raw files | |
for f in *.CR2 *.cr2; | |
do | |
echo "Processing $f" | |
ufraw-batch \ | |
--wb=camera \ | |
--exposure=auto \ | |
--out-type=jpeg \ | |
--compression=96 \ | |
--out-path=./processed_images \ | |
$f | |
done | |
cd ./processed_images | |
#change the image names | |
for i in *.jpg; | |
do | |
mv "$i" "${i/.jpg}"_r.jpg; | |
done | |
for i in *.jpg; | |
do | |
mv "$i" "${i/imgp/_igp}"; | |
done | |
else | |
echo "not a directory" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment