Skip to content

Instantly share code, notes, and snippets.

@dgouyette
Created January 3, 2011 16:15
Show Gist options
  • Save dgouyette/763621 to your computer and use it in GitHub Desktop.
Save dgouyette/763621 to your computer and use it in GitHub Desktop.
auto rotate picture from exif informations and regenerate thumbnail for dotclear
#!/bin/sh
for FILE in $( ls public); do
jhead -exifmap "public/"$FILE | grep "Orientation" >/dev/null
if [ $? -eq 0 ]
then
echo "public/"$FILE
jhead -autorot "public/"$FILE
fi
done
for FILE in $( ls public); do
echo "Génération thumbnail"
echo "file : "$FILE
NAME=`echo "$FILE" | cut -d'.' -f1`
#cp "public/"$FILE "public/"$NAME"_sq.JPG"
convert -thumbnail 48 "public/$FILE" "public/".$NAME"_sq.jpg"
convert -thumbnail 100 "public/$FILE" "public/."$NAME"_t.jpg"
convert -thumbnail 240 "public/$FILE" "public/."$NAME"_s.jpg"
convert -thumbnail 448 "public/$FILE" "public/."$NAME"_m.jpg"
done
#NAME=`echo "$FILE" | cut -d'.' -f1`
#EXTENSION=`echo "$FILE" | cut -d'.' -f2`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment