Using stdin and stdout

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

Post Reply
NemoAlex
Posts: 1
Joined: Sun Sep 26, 2021 1:27 pm

Using stdin and stdout

Post by NemoAlex »

Hi, Awesome works!
I try to use nconvert with stdin and stdout but met two problems.

When I pipe a png file to nconvert,

Code: Select all

cat ./test.png | nconvert -quiet -out jpeg -o stdout stdin
It shows an error:

Code: Select all

Error: Don't know how to read this picture (stdin)
Same command works on jpeg file fine:

Code: Select all

cat ./test.jpeg | nconvert -quiet -out jpeg -o stdout stdin
works good but come with another problem: It outputs a line of version infomation:

Code: Select all

 Version : 10 16

So I need to remove the first line of output:

Code: Select all

cat ./test.jpeg | nconvert -quiet -out jpeg -o stdout stdin | tail -n +2


BTW: The test env is macOS with m1 chips.
Post Reply