Fix suggested output dir to be the same as input file
This commit is contained in:
parent
239665f3f5
commit
c7830ec1d3
1 changed files with 7 additions and 1 deletions
|
@ -139,6 +139,12 @@ VERSION="1.1"
|
|||
ZENITY=$(which zenity)
|
||||
|
||||
pdf_file=$(basename "$1")
|
||||
if [ $( echo "$1"|grep -c '^\/' ) -eq 0 ]
|
||||
then
|
||||
default_output_dir=$( pwd )/$( dirname $1 )
|
||||
else
|
||||
default_output_dir=$( dirname $1 )
|
||||
fi
|
||||
|
||||
# Check if Ghostscript is installed
|
||||
GS="/usr/bin/ghostscript"
|
||||
|
@ -189,7 +195,7 @@ case $selected_level in
|
|||
esac
|
||||
|
||||
# Choose output file name
|
||||
suggested_filename=compressed-"$pdf_file"
|
||||
suggested_filename="$default_output_dir/compressed-$pdf_file"
|
||||
output_filename=$($ZENITY --file-selection --save --confirm-overwrite --filename="$suggested_filename" --title="$label_filename")
|
||||
|
||||
if [ "$?" = 1 ] ; then
|
||||
|
|
Loading…
Reference in a new issue