Skip to content

Commit

Permalink
Enhance tool to fix images
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 30, 2014
1 parent e395fd8 commit 86e04cb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion dev/optimize_images.sh
Expand Up @@ -10,6 +10,7 @@ INPLACE='0'
max_input_size=0
max_output_size=0


usage()
{
cat <<EO
Expand Down Expand Up @@ -101,7 +102,7 @@ main()
OUTPUT='/tmp/optimize'
fi

echo "Mode is $INPLACE (0=Images are replaced, 1=New images are stored into $OUTPUT)"
echo "Mode is $INPLACE (1=Images are replaced, 0=New images are stored into $OUTPUT)"

# We create the output directory
mkdir -p $OUTPUT
Expand Down Expand Up @@ -179,6 +180,13 @@ SHORTOPTS="h,i:,o:,q,s,p"
LONGOPTS="help,input:,output:,quiet,no-stats,inplace"
ARGS=$(getopt -s bash --options $SHORTOPTS --longoptions $LONGOPTS --name $PROGNAME -- "$@")

# Syntax
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
then
echo "Usage: optimize_images.sh (list|fix) -i dirtoscan"
exit
fi

eval set -- "$ARGS"
while true; do
case $1 in
Expand Down Expand Up @@ -215,5 +223,11 @@ while true; do
shift
done

# To convert
if [ "x$1" = "xlist" ]
then
INPLACE=0
fi

main

0 comments on commit 86e04cb

Please sign in to comment.