t/355_unpaper2.t test fails in gscan2pdf-1.8.5
Brought to you by:
ra28145
t/355_unpaper2.t test fails in gscan2pdf-1.8.5:
$ xvfb-run -a perl -Ilib t/355_unpaper2.t 1..3 2017/08/22 13:03:49 Caught error getting pixbuf: Failed to load image '/tmp/BQi0sBTaZH/8F4NNwslOG.pnm': reason not known, probably a corrupt image file at lib/Gscan2pdf/Document.pm line 892. /tmp/BQi0sBTaZH/tnmKxA7OW1.pnm PBM 501x100 501x100+0+0 1-bit Bilevel Gray 6334B 0.000u 0:00.000 ok 1 - valid PNM created for LH identify: improper image header `/tmp/BQi0sBTaZH/8F4NNwslOG.pnm' @ error/pnm.c/ReadPNMImage/284. not ok 2 - valid PNM created for RH # Failed test 'valid PNM created for RH' # at t/355_unpaper2.t line 47. # got: '256' # expected: '0' ok 3 - using session directory # Looks like you failed 1 test of 3.
This happens since commit:
commit 515cdb9d159df3424e862ebdd9daf4abaae17de3 (HEAD, refs/bisect/bad) Author: Jeffrey Ratcliffe <Jeffrey.Ratcliffe@gmail.com> Date: Fri Aug 4 21:30:23 2017 +0200 Log program versions as well as their existence
Strace shows the unpaper was called as:
["unpaper", "--layout", "double", "--output-pages", "2", "--overwrite", "--input-file-sequence", "/tmp/sHvwKlVeAv/n8TOucU4hX.pbm", "--output-file-sequence", "/tmp/sHvwKlVeAv/9SbOvekTNP.pnm", "/tmp/sHvwKlVeAv/mvTJzSZWNH.pnm"]
Now it is called as:
["unpaper", "--layout", "double", "--output-pages", "2", "--overwrite", "/tmp/mlqmZKpfo3/GDK1nZmj73.pbm", "/tmp/mlqmZKpfo3/4sJ5OPeeUO.pnm", "/tmp/mlqmZKpfo3/UjcjSelXCL.pnm"]
I have unpaper version 0.3.
There is a change in the unpaper version detection. version() method returened "v0.3", now it returns "0.3". Thus the parameters are missing.
Attached patch adds a new Gscan2pdf::Unpaper method to fix it.
Thanks for the report. Here's my fix.