I'm using vncsnapshot-png which outputs a PNG file to stdout. (In fact, that code as written does not allow outputting the PNG to stdout; I've patched it locally to allow that.) I want to pipe this to convert but I invariably get an error like this:
Code: Select all
$ vncsnapshot -quiet -passwd passwd localhost - | convert png:- png:- > foo.png
32 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 255 green 255 blue 255, shift red 0 green 8 blue 16
convert: Expected 8192 bytes; found 8139 bytes `-' @ warning/png.c/MagickPNGWarningHandler/1777.
convert: Read Exception `-' @ error/png.c/MagickPNGErrorHandler/1751.
convert: corrupt image `-' @ error/png.c/ReadPNGImage/3791.
convert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3044.
$
Code: Select all
$ vncsnapshot -quiet -passwd passwd localhost - > tmp.png
32 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 255 green 255 blue 255, shift red 0 green 8 blue 16
$ convert png:- png:- < tmp.png > foo.png
$