Pipe output (*.jpg file) of one command to another with CMD. Multiple command in MozJPEG

149 views Asked by At

How can I get Windows CMD to understand this type of things, what I have in bash:

cjpeg /jpg/image.jpg | jpegtran -optimize > result/jpg/image.jpg

I want to pipe the output of one MozJPEG command into another.

P.S.

Before I used 'temp' folder in my script.

cjpeg -quality 80 /jpg/image.jpg > /temp/image.jpg
jpegtran -optimize /temp/image.jpg > /result/jpg/image.jpg

Run first command - save result in temp. After this, take file from 'temp' and pass it into second command - save final result. But it creates unnecessary actions and garbage in folders :(

Will be appreciated for any help and advices!

0

There are 0 answers