summaryrefslogtreecommitdiff
path: root/jpegrotate
diff options
context:
space:
mode:
Diffstat (limited to 'jpegrotate')
-rw-r--r--jpegrotate10
1 files changed, 10 insertions, 0 deletions
diff --git a/jpegrotate b/jpegrotate
new file mode 100644
index 0000000..ee7c3a8
--- /dev/null
+++ b/jpegrotate
@@ -0,0 +1,10 @@
+#!/bin/sh
+# src http://www.zmatt.net/files/jpegrotate
+
+for file in $*
+do
+ echo $file
+ rotate=`jhead $file |grep '^Orientation : rotate [0-9]\+$' | sed 's/^Orientation : /-/'`;
+ jpegtran $rotate -optimize -copy all $file >$file.tmp && mv $file.tmp $file
+done
+