I am using the Windows libvips
CLI to convert images from HEIC
to PNG
format. I want to pipe the converted output to another process without writing to disk. This can be achieved by writing to stdout
(i.e. typing only the file extension as output file):
vips copy input.heic .png
However, if I write to a file instead:
vips copy input.heic output.png
and compare the stdout
byte stream to the contents of output.png
, they are somewhat different. Indeed, writing stdout
to a file results in a corrupted PNG.
Further analysis made me realise that the difference between stdout
and output.png
is a large number of randomly placed CR
characters in stdout
that are not present in the file. Everything else is identical.
Is there any way to get the right byte stream in stdout
as it was read from output.png
?