Permalink
Browse files

Move jpeg optim to a function.

  • Loading branch information...
1 parent 118adfb commit c8a179abfdcd17b3bc5b8864b9ba9dbeba9df257 @stefanbeller stefanbeller committed Jan 16, 2013
Showing with 17 additions and 5 deletions.
  1. +17 −5 image_optim.sh
View
@@ -17,8 +17,6 @@ timestartglobal()
{
TSG=`date +%s.%N`
}
-timestartglobal
-
timeendglobal()
{
@@ -27,8 +25,6 @@ timeendglobal()
echo "$TDG"
}
-
-
timestart()
{
TS=`date +%s.%N`
@@ -40,7 +36,23 @@ timeend()
TD=`calc $TE - $TS`
}
-git ls-files ./ | grep -e "\.jpg$" -e "\.jpeg" | xargs -P 0 -n 1 jpegoptim --strip-all >> /tmp/mytrimage_jpeg.log
+print()
+{
+ ${VERBOSE} && echo $1
+}
+
+jpeg_remove_comment_and_exiv()
+{
+ print "Removing comments and exiv data from jpegs."
+ timestart
+ git ls-files ./ | grep -e "\.jpg$" -e "\.jpeg" | xargs -P 0 -n 1 jpegoptim --strip-all >> /tmp/mytrimage_jpeg.log
+ timeend
+ print "$TD"
+}
+
+VERBOSE=true
+timestartglobal
+jpeg_remove_comment_and_exiv
for i in $(git ls-files ./ | grep "\.png$"); do # png

0 comments on commit c8a179a

Please sign in to comment.