diff options
author | Arun Persaud <arun@nubati.net> | 2011-11-24 09:58:16 -0800 |
---|---|---|
committer | Arun Persaud <apersaud@lbl.gov> | 2011-11-24 09:58:16 -0800 |
commit | f55f4ad4dacb726861a7e6c34a471d468d2e24d3 (patch) | |
tree | 510d0c7c3d2eab51c624038c4d4377d2e0fd8389 | |
parent | 8c294704502f0abfb554baec7d372a9bf6a0f6c6 (diff) | |
download | photo-tags-f55f4ad4dacb726861a7e6c34a471d468d2e24d3.tar.gz photo-tags-f55f4ad4dacb726861a7e6c34a471d468d2e24d3.tar.bz2 photo-tags-f55f4ad4dacb726861a7e6c34a471d468d2e24d3.zip |
use nice for all commands issued while creating thumbnails
-rwxr-xr-x | create_thumbnails.sh | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/create_thumbnails.sh b/create_thumbnails.sh index 6bae6bb..a1c460e 100755 --- a/create_thumbnails.sh +++ b/create_thumbnails.sh @@ -1,5 +1,7 @@ #!/bin/bash +NICE="nice -19" + # init some variables removemeta=0 @@ -57,7 +59,7 @@ FILES="" while [ $done -lt 100 ] ; do echo "skipping $offset pics, getting 50 new pics to work on..." # handle white space in filename correctly - FILES=`sqlite3 $LOCALDB "select replace(base_uri||'/'||filename,' ','%20') from photos limit $offset,100"` + FILES=`$NICE sqlite3 $LOCALDB "select replace(base_uri||'/'||filename,' ','%20') from photos limit $offset,100"` if [ "x$FILES" != "x" ] ; then #found some files, process them @@ -70,23 +72,23 @@ while [ $done -lt 100 ] ; do if [ ! -s "Photos-tiny/$dir/$base" ] ; then mkdir -p Photos-tiny/$dir - nice -19 convert "$dirprefix/$file" -auto-orient -resize x100 -quality 80% "Photos-tiny/$dir/$base" + $NICE convert "$dirprefix/$file" -auto-orient -resize x100 -quality 80% "Photos-tiny/$dir/$base" if [ $removemeta=1 ]; then - jhead -q -se -purejpg "Photos-tiny/$dir/$base" - jhead -q -se -dt "Photos-tiny/$dir/$base" - jhead -q -se -mkexif "Photos-tiny/$dir/$base" - jhead -q -se -cl "This photo belongs to $admin and was taken from $webbase. If you want to use this photo, please contact him." "Photos-tiny/$dir/$base" + $NICE jhead -q -se -purejpg "Photos-tiny/$dir/$base" + $NICE jhead -q -se -dt "Photos-tiny/$dir/$base" + $NICE jhead -q -se -mkexif "Photos-tiny/$dir/$base" + $NICE jhead -q -se -cl "This photo belongs to $admin and was taken from $webbase. If you want to use this photo, please contact him." "Photos-tiny/$dir/$base" fi done=$((done+1)) fi if [ ! -s "Photos-small/$dir/$base" ] ; then mkdir -p Photos-small/$dir - nice -19 convert "$dirprefix/$file" -auto-orient -resize x600 -quality 80% "Photos-small/$dir/$base" + $NICE convert "$dirprefix/$file" -auto-orient -resize x600 -quality 80% "Photos-small/$dir/$base" if [ $removemeta=1 ]; then - jhead -q -se -purejpg "Photos-small/$dir/$base" - jhead -q -se -dt "Photos-small/$dir/$base" - jhead -q -se -mkexif "Photos-small/$dir/$base" - jhead -q -se -cl "This photo belongs to $admin and was taken from $webbase. If you want to use this photo, please contact him." "Photos-small/$dir/$base" + $NICE jhead -q -se -purejpg "Photos-small/$dir/$base" + $NICE jhead -q -se -dt "Photos-small/$dir/$base" + $NICE jhead -q -se -mkexif "Photos-small/$dir/$base" + $NICE jhead -q -se -cl "This photo belongs to $admin and was taken from $webbase. If you want to use this photo, please contact him." "Photos-small/$dir/$base" fi done=$((done+1)) fi |