|
|
|
@ -78,7 +78,7 @@ function arg_parse
|
|
|
|
|
|
|
|
|
|
function yes_or_no
|
|
|
|
|
{
|
|
|
|
|
read -p "$* [y/N]: " ans
|
|
|
|
|
read -pr "$* [y/N]: " ans
|
|
|
|
|
case "$ans" in
|
|
|
|
|
[yY] | [yY]es ) return 0;;
|
|
|
|
|
* ) echo "Aborting"; return 1;;
|
|
|
|
@ -103,8 +103,8 @@ ${bold}$output_path${normal}."
|
|
|
|
|
-dNOPAUSE \
|
|
|
|
|
-dQUIET \
|
|
|
|
|
-dBATCH \
|
|
|
|
|
-sOutputFile=$output_path \
|
|
|
|
|
$input_path
|
|
|
|
|
-sOutputFile="$output_path" \
|
|
|
|
|
"$input_path"
|
|
|
|
|
else
|
|
|
|
|
echo "input_path=$input_path";
|
|
|
|
|
echo "output_path=$output_path";
|
|
|
|
@ -117,8 +117,8 @@ ${bold}$output_path${normal}."
|
|
|
|
|
-dPDFSETTINGS=/prepress \
|
|
|
|
|
-dNOPAUSE \
|
|
|
|
|
-dBATCH \
|
|
|
|
|
-sOutputFile=$output_path \
|
|
|
|
|
$input_path
|
|
|
|
|
-sOutputFile="$output_path" \
|
|
|
|
|
"$input_path"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# catching errors
|
|
|
|
@ -136,11 +136,11 @@ ${bold}$output_path${normal}."
|
|
|
|
|
|
|
|
|
|
function compute_compression
|
|
|
|
|
{
|
|
|
|
|
input_size=`du "$input_path" | cut -f1`
|
|
|
|
|
output_size=`du "$output_path" | cut -f1`
|
|
|
|
|
percentage=`echo "scale=1;$output_size / $input_size * 100" | bc -l`
|
|
|
|
|
input_size_h=`du -h "$input_path" | cut -f1`
|
|
|
|
|
output_size_h=`du -h "$output_path" | cut -f1`
|
|
|
|
|
input_size=$(du "$input_path" | cut -f1)
|
|
|
|
|
output_size=$(du "$output_path" | cut -f1)
|
|
|
|
|
percentage=$(echo "scale=1;$output_size / $input_size * 100" | bc -l)
|
|
|
|
|
input_size_h=$(du -h "$input_path" | cut -f1)
|
|
|
|
|
output_size_h=$(du -h "$output_path" | cut -f1)
|
|
|
|
|
|
|
|
|
|
echo "Size reduced from ${bold}$input_size_h${normal} to \
|
|
|
|
|
${bold}$output_size_h${normal} [$percentage %]"
|
|
|
|
|