Enhance tool to fix images
This commit is contained in:
parent
e395fd8096
commit
86e04cb62f
@ -10,6 +10,7 @@ INPLACE='0'
|
|||||||
max_input_size=0
|
max_input_size=0
|
||||||
max_output_size=0
|
max_output_size=0
|
||||||
|
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
cat <<EO
|
cat <<EO
|
||||||
@ -101,7 +102,7 @@ main()
|
|||||||
OUTPUT='/tmp/optimize'
|
OUTPUT='/tmp/optimize'
|
||||||
fi
|
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
|
# We create the output directory
|
||||||
mkdir -p $OUTPUT
|
mkdir -p $OUTPUT
|
||||||
@ -179,6 +180,13 @@ SHORTOPTS="h,i:,o:,q,s,p"
|
|||||||
LONGOPTS="help,input:,output:,quiet,no-stats,inplace"
|
LONGOPTS="help,input:,output:,quiet,no-stats,inplace"
|
||||||
ARGS=$(getopt -s bash --options $SHORTOPTS --longoptions $LONGOPTS --name $PROGNAME -- "$@")
|
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"
|
eval set -- "$ARGS"
|
||||||
while true; do
|
while true; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@ -215,5 +223,11 @@ while true; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# To convert
|
||||||
|
if [ "x$1" = "xlist" ]
|
||||||
|
then
|
||||||
|
INPLACE=0
|
||||||
|
fi
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user