From a45bb470ad006008f1e939fd5293773f2f8ede0a Mon Sep 17 00:00:00 2001 From: Serge V Shistarev Date: Fri, 21 Mar 2014 18:05:09 +0900 Subject: [PATCH] Modified for systems without inotify (e.g. OS X, *BSD, etc) --- pstoricohddst-gdi | 188 ++++++++++++++++++++++++++++++---------------- 1 file changed, 124 insertions(+), 64 deletions(-) diff --git a/pstoricohddst-gdi b/pstoricohddst-gdi index 2913dd3..122d19e 100755 --- a/pstoricohddst-gdi +++ b/pstoricohddst-gdi @@ -30,74 +30,134 @@ ddate="`LC_ALL=en_US.UTF-8 date '+%Y/%m/%d %H:%M:%S'`" uid="/tmp/pstoricohddst-gdi-`uuidgen`" mkdir -p $uid -( -stage="empty" -inotifywait -q -m -r -e close_write --format '%f' $uid | grep --line-buffered 'page.pbm$' | while read page; do - # page submitted - [ "$stage" = "empty" ] && { - # Flushing PJL header - cat < $uid/raster.jbig + + # Taking image size + jsize=`wc -c < $uid/raster.jbig` + + # Taking image dimensions + read fn ft xs ys garb < <(identify $uid/$page | tr "x" " ") + + # Flushing page header + cat < $uid/raster.jbig + + # Taking image size + jsize=`wc -c < $uid/raster.jbig` + + # Taking image dimensions + read fn ft xs ys garb < <(identify $page | tr "x" " ") + + # Flushing page header + cat < $uid/raster.jbig - - # Taking image size - jsize=`wc -c < $uid/raster.jbig` - - # Taking image dimensions - read fn ft xs ys garb < <(identify $uid/$page | tr "x" " ") - - # Flushing page header - cat <