Program enters infinite loop if called without arguments? #133

Closed
opened 2022-03-19 21:18:39 +00:00 by mara0004 · 2 comments
Contributor

When I run only img2pdf without arguments, nothing happens, but the process keeps busy. It looks like it might have entered an infinite loop. Is this the desired behaviour? I would rather have expected it to abort with an error message.

When I run only `img2pdf` without arguments, nothing happens, but the process keeps busy. It looks like it might have entered an infinite loop. Is this the desired behaviour? I would rather have expected it to abort with an error message.
Owner

Yes, this is documented in the --help output for the infile option:

If no input images are given, then a single image is read from standard input.

This is so that img2pdf can be used as part of the pipeline like so:

img2pdf < input.jpg > output.pdf

This is useful for situations where the image is created by another program and you want to avoid first having to write out a temporary file. So instead of creating a temporary file you can then do:

program-producing-image-on-stdout | img2pdf > output.pdf
Yes, this is documented in the `--help` output for the `infile` option: > If no input images are given, then a single image is read from standard input. This is so that img2pdf can be used as part of the pipeline like so: img2pdf < input.jpg > output.pdf This is useful for situations where the image is created by another program and you want to avoid first having to write out a temporary file. So instead of creating a temporary file you can then do: program-producing-image-on-stdout | img2pdf > output.pdf
Author
Contributor

Ok, that makes sense, thanks!

Ok, that makes sense, thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: josch/img2pdf#133
No description provided.