diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-03-29 20:17:53 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-03-29 20:25:17 +0200 |
commit | 5334fe011840002bbd5ec86b3e361c73e73a3a50 (patch) | |
tree | 22f22de726b32f55682ae811134780b6d053a6f5 | |
parent | 87aa02b47cbf3145fde7297302c8f549d062fbc7 (diff) | |
download | impressive-display-5334fe011840002bbd5ec86b3e361c73e73a3a50.tar.gz impressive-display-5334fe011840002bbd5ec86b3e361c73e73a3a50.tar.bz2 impressive-display-5334fe011840002bbd5ec86b3e361c73e73a3a50.zip |
Check downloaded PDF for actually being a PDF file.
-rw-r--r-- | debian/changelog | 1 | ||||
-rwxr-xr-x | impressive-display/bin/impressive-display | 20 |
2 files changed, 15 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index 805239b..50c3021 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ impressive-display (0.2.1) UNRELEASED; urgency=medium files, make sure the impressive executable gets killed during clean-up. * Disable debugging option (set -x). * Use $HOME/.impressive-display as temporary data directory. + * Check downloaded PDF for actually being a PDF file. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Tue, 29 Mar 2016 20:14:17 +0200 diff --git a/impressive-display/bin/impressive-display b/impressive-display/bin/impressive-display index b962412..4ba691d 100755 --- a/impressive-display/bin/impressive-display +++ b/impressive-display/bin/impressive-display @@ -250,14 +250,22 @@ function download_pdffile { fi curl $creds "$PDF_URL" 1> "$pdffile_downloaded" 2>/dev/null - merge_portrait_documents + if pdfinfo "$pdffile_downloaded" 1>/dev/null 2>/dev/null; then - cmp -s "$pdffile_downloaded" "$pdffile_previous"> /dev/null - if [ $? -eq 1 ]; then - echo -n "RELOAD" > $impressive_lock - fi + merge_portrait_documents + + cmp -s "$pdffile_downloaded" "$pdffile_previous"> /dev/null + if [ $? -eq 1 ]; then + echo -n "RELOAD" > $impressive_lock + fi + + pdffile=$pdffile_display - pdffile=$pdffile_display + else + + echo "WARNING: PDF file format problems. Maybe not a PDF file?" + + fi } |