Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
8f256433a2 | |||
c7830ec1d3 |
2 changed files with 13 additions and 1 deletions
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -1,3 +1,9 @@
|
||||||
|
compress-pdf (1.5-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* Fix suggested output dir to be the same as input file
|
||||||
|
|
||||||
|
-- Benjamin Renard <brenard@zionetrix.net> Mon, 17 Apr 2017 23:33:25 +0200
|
||||||
|
|
||||||
compress-pdf (1.4-1) unstable; urgency=low
|
compress-pdf (1.4-1) unstable; urgency=low
|
||||||
|
|
||||||
* Initial Debian release
|
* Initial Debian release
|
||||||
|
|
|
@ -139,6 +139,12 @@ VERSION="1.1"
|
||||||
ZENITY=$(which zenity)
|
ZENITY=$(which zenity)
|
||||||
|
|
||||||
pdf_file=$(basename "$1")
|
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
|
# Check if Ghostscript is installed
|
||||||
GS="/usr/bin/ghostscript"
|
GS="/usr/bin/ghostscript"
|
||||||
|
@ -189,7 +195,7 @@ case $selected_level in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Choose output file name
|
# 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")
|
output_filename=$($ZENITY --file-selection --save --confirm-overwrite --filename="$suggested_filename" --title="$label_filename")
|
||||||
|
|
||||||
if [ "$?" = 1 ] ; then
|
if [ "$?" = 1 ] ; then
|
||||||
|
|
Loading…
Reference in a new issue