convert: Expected 8192 bytes; found 8139 bytes
Posted: 2012-10-20T01:20:12-07:00
Hello, I'm encountering what seems like a bug in ImageMagick 6.8.0-1, which is running on OS X 10.8.2 Mountain Lion and was compiled with Apple clang version 4.1 (tags/Apple/clang-421.11.65) (based on LLVM 3.1svn).
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:
There's no error if I redirect vncsnapshot's output PNG to a file, then have convert read that file; this is what makes me think it's a bug in ImageMagick, not in vncsnapshot-png.
I'd like to avoid that extra I/O. There's also no problem if I use the original vncsnapshot which outputs JPEG instead of PNG, but I'd prefer to start with a non-lossy source.
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
$