Using stdin and stdout
Posted: Sun Sep 26, 2021 1:43 pm
Hi, Awesome works!
I try to use nconvert with stdin and stdout but met two problems.
When I pipe a png file to nconvert,
It shows an error:
Same command works on jpeg file fine:
works good but come with another problem: It outputs a line of version infomation:
So I need to remove the first line of output:
BTW: The test env is macOS with m1 chips.
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
Code: Select all
Error: Don't know how to read this picture (stdin)
Code: Select all
cat ./test.jpeg | nconvert -quiet -out jpeg -o stdout stdin
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.