unpaper: error: no input or output files given.

Bug #1921628 reported by Bill Yikes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unpaper (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ unpaper -t pbm --overwrite raw_pg-000_im_th35.pbm
unpaper: error: no input or output files given.

Try 'man unpaper' for more information.

$ ls -l raw_pg-000_im_th35.pbm
-rw-r--r-- 1 user user 1052713 Mar 28 09:45 raw_pg-000_im_th35.pbm

So the file exists, but unpaper falls over with this bogus error. This has worked for me previously but not today. Thus, it may be difficult to reproduce.

$ unpaper --version
6.1

Revision history for this message
Bill Yikes (yik3s) wrote :

The workaround is to give up the --overwrite option, create a temp file, and copy it back over the source:

$ unpaper -t pbm raw_pg-000_im_th35.pbm raw_pg-000_unpapered.pbm && mv -v raw_pg-000_unpapered.pbm raw_pg-000_im_th35.pbm
Processing sheet #1: raw_pg-000_im_th35.pbm -> raw_pg-000_unpapered.pbm
[image2 @ 0x5561ee6a2ae0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[image2 @ 0x5561ee6a2ae0] Encoder did not produce proper pts, making some up.
'raw_pg-000_unpapered.pbm' -> 'raw_pg-000_im_th35.pbm'

I probably should have mentioned --overwrite in the subject of this report.. can't change it now.

Revision history for this message
Bill Yikes (yik3s) wrote :

yikes, a destructive manifestation of the same bug:

If a list of files is given with the --overwrite option, it actually clobbers one file with the output of the other.

hmm.. actually I've misunderstood the man page:

--overwrite
           Allow overwriting existing files. Otherwise the program terminates with an error if an output file to be written already exists.

I thought "overwrite" meant to overwrite the source doc, not that it was okay to overwrite the 2nd in a list. So in the end this may just be a documentation problem. I suggesting making the docs more clear. I believe this is incorrect BNF:

  unpaper [options] {input-pattern output-pattern | input-file(s) output-file(s)}

braces are invalid BNF; they should be parenthesis, and there should be angle brackets like this:

  unpaper [options] (<input pattern> <output pattern> | <input file(s)> <output file(s)>)

then the non-obvious things in angle brackets should be defined separately, like pattern. Patterns come in many forms. I tried giving '*.pgm' as a pattern and it was rejected.

Also, I suggest an "--in-place" option of sorts so users can operate directly on the source and not give an output file.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.