Created
January 3, 2011 16:15
-
-
Save dgouyette/763621 to your computer and use it in GitHub Desktop.
auto rotate picture from exif informations and regenerate thumbnail for dotclear
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/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