On first inspection it looks like some code already exists for writing an image to stdout (standard output).
if (strcmp(m_szImageFilename, "stdout")) { //... network output code hidden for clarity ... } else // it's stdout { m_fImageFile = stdout; showDebug(1, "image will be on stdout\n"); }
Unlike stdin for restore, stdout for save is not currently available in the command line options. I did do a build earlier where I enabled it (which I donβt have any more due to my build problems). I managed to pipe an image to hexdump and seemed to be able to see some of the user interface info in the output.
It would seem the problem with the stdout option is that even in batch mode the program outputs interface data to stdout, which then corrupts the image.
I think I shall attempt to remove all the UI stuff, and make it act more like all the other unix tools. Might also try to create a reusable library out of it.