The run time error of ImageToFile in MagickCore
Posted: 2011-04-28T01:24:38-07:00
I use the ConstituteImage function to generate a GRAY Level image, then use the ImageToFile function to save the image file in JPEG format.
The version of ImageMagick is 6.5.4-8 2009-10-24 Q16 OpenMP.
Here is the code.
ExceptionInfo *exception;
exception = AcquireExceptionInfo();
Image *img;
img = ConstituteImage(height, width, "I", CharPixel, imgBlobBuffer, exception); //imgBlobBuffer is an Unsigned Char array, and one byte per pixel
ImageToFile(img, Path, exception); //Path is file path like this "./test.jpeg"
I get a run time error at ImageToFile function:
magick/blob.c:1523: ImageToFile: Assertion `image->blob->type != UndefinedStream' failed. Aborted
Does anybody could tell me what wrong is it?
The version of ImageMagick is 6.5.4-8 2009-10-24 Q16 OpenMP.
Here is the code.
ExceptionInfo *exception;
exception = AcquireExceptionInfo();
Image *img;
img = ConstituteImage(height, width, "I", CharPixel, imgBlobBuffer, exception); //imgBlobBuffer is an Unsigned Char array, and one byte per pixel
ImageToFile(img, Path, exception); //Path is file path like this "./test.jpeg"
I get a run time error at ImageToFile function:
magick/blob.c:1523: ImageToFile: Assertion `image->blob->type != UndefinedStream' failed. Aborted
Does anybody could tell me what wrong is it?