Program enters infinite loop if called without arguments? #133

Closed
opened 2 years ago by mara0004 · 2 comments

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.
josch commented 2 years ago
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
Poster

Ok, that makes sense, thanks!

Ok, that makes sense, thanks!
mara0004 closed this issue 2 years ago
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
Loading…
There is no content yet.