$ cat wide-orientation
#!/bin/sh
for f in "$@" ; do
eval `identify "$f" | cut -f3 -d' ' | sed 's/x/; export H=/ ; s/^/export W=/' `
if [ "$H" -gt 0 -a "$W" -gt 0 -a $H -gt $W ] ; then
echo Changing $f from ${W}x${H} to ${H}x${W}...
#convert -verbose -rotate "90<" $f $f
jpegtran -rotate 90 -trim "$f" > "$f.1"
mv -f "$f.1" "$f"
else
echo Not altering "$f"...
fi
# this alone will do it, but it's SLOW
# convert -verbose -rotate "90<" $f $f
done
# vim:ft=sh
for f in "$@" ; do
eval `identify "$f" | cut -f3 -d' ' | sed 's/x/; export H=/ ; s/^/export W=/' `
if [ "$H" -gt 0 -a "$W" -gt 0 -a $H -gt $W ] ; then
echo Changing $f from ${W}x${H} to ${H}x${W}...
#convert -verbose -rotate "90<" $f $f
jpegtran -rotate 90 -trim "$f" > "$f.1"
mv -f "$f.1" "$f"
else
echo Not altering "$f"...
fi
# this alone will do it, but it's SLOW
# convert -verbose -rotate "90<" $f $f
done
# vim:ft=sh
No comments:
Post a Comment