Mercurial > hgrepos > hgweb.cgi > s4
changeset 917:070e933c7896
Calling gs silently
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Fri, 08 Jan 2021 19:34:27 +0900 |
parents | 7cac220d52a7 |
children | 95c066490083 |
files | s4-funcs.sh |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/s4-funcs.sh Fri Jan 08 19:17:31 2021 +0900 +++ b/s4-funcs.sh Fri Jan 08 19:34:27 2021 +0900 @@ -1058,7 +1058,7 @@ if type gs >/dev/null 2>&1; then gs_pdfwrite() { gs -sDEVICE=pdfwrite -dPDFSETTINGS=/default \ - -dNOPAUSE -dQUIET -dBATCH -o "$2" "$1" + -dNOPAUSE -dQUIET -dBATCH -o "$2" "$1" >/dev/null 2>&1 } fi enjpeg() { @@ -1589,11 +1589,12 @@ [Aa]pplication/[Pp][Dd][Ff]) if [ x"`getpar comppdf`" = x"yes" ]; then if type gs_pdfwrite >/dev/null 2>&1; then - err Calling gs - gs_pdfwrite "$tmpd/$v" "$tmpd/$v.mini.pdf" && { - err "PDF compressed: `ls -lF $tmpd/${v}*`" - mv "$tmpd/$v.mini.pdf" "$tmpd/$v" - } + nv=${v%.pdf}-comp.pdf + err Calling gs from $v to $nv + if gs_pdfwrite "$tmpd/$v" "$tmpd/$nv"; then + err "PDF compressed: `ls -lF $tmpd/*.pdf`" + v=$nv + fi fi fi esac