MagickImage.Write 0 size empty result
Posted: 2017-04-26T06:41:16-07:00
Hi,
I've got some code that uses MagickImage class.
The code used to work (I thought) so obviously something's changed, and I'm trying to troubleshoot the problem...
My code looks like this:
The issue is that after the
image.Write(ms);
the ms.Length is 0 even though the image is 2495x3501
No exception is thrown
Any ideas?
Thanks
Martin
I've got some code that uses MagickImage class.
The code used to work (I thought) so obviously something's changed, and I'm trying to troubleshoot the problem...
My code looks like this:
Code: Select all
MemoryStream ms = null;
MagickImage image = new MagickImage(data, readSettings);
image.Format = MagickFormat.Bmp;// Png;//Bmp3;
ms = new MemoryStream();
image.Write(ms);
image.Dispose(); image = null;
byte[] result = ms.GetBuffer();
ms.Dispose();
image.Write(ms);
the ms.Length is 0 even though the image is 2495x3501
No exception is thrown
Any ideas?
Thanks
Martin