Search This Blog

Saturday, October 07, 2006

Camera.sh v2

I rewrite my script for converting raw format pictures. Now, it is converting files from raw to jpg in loop. Doing first convert of all raw files take a lot of space (ppm files are BIG). Right now I need space for one ppm file. Morover, ppm->jpg converting and resizing are made in one step. I found very nice perl program (ExifTool) to managing exif info.
#!/bin/sh

EXIFPATH=/opt/Image-ExifTool-6.36
for raf in *.raf
do 
        dcraw -w $raf
        name=`basename $raf .raf`
        jpg=`basename $name`.jpg
        ppm=`basename $name`.ppm
        echo $name
        convert -resize 800x600 $ppm $jpg
        $EXIFPATH/exiftool -TagsFromFile $raf $jpg
        rm $ppm $jpg"_original"
done
Post a Comment