MagickIdentifyImage + pseudo image crash
Posted: 2014-05-21T15:54:01-07:00
Hi,
Calling MagickIdentifyImage on an image created through MagickNewImage appears to crash with the message:
Calling MagickIdentifyImage on an image created through MagickNewImage appears to crash with the message:
Code example is below, or can be downloaded from https://github.com/Danack/imagemagickte ... identify.c where there is also a terrible make file (make identify') in the unlikely event that you need that. Apparently setting an image format when creating the image is a work-around to avoid the issue.identify: magick/magick.c:662: GetMagickMimeType: Assertion `magick_info != (MagickInfo *) ((void *)0)' failed.
about to identifyAborted
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wand/MagickWand.h>
void ThrowWandException(MagickWand *wand) {
char *description;
ExceptionType severity;
description = MagickGetException(wand, &severity);
(void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description);
description=(char *) MagickRelinquishMemory(description);
exit(-1);
}
int main(int argc,char **argv) {
MagickBooleanType status;
MagickWand *magick_wand, *pseudo_wand;
char *filename;
MagickWandGenesis();
PixelWand *pixel_wand = NULL;
pixel_wand = NewPixelWand();
PixelSetColor(pixel_wand, "white");
magick_wand = NewMagickWand();
int columns = 16;
int rows = 16;
status = MagickNewImage(magick_wand, columns, rows, pixel_wand);
if (status == MagickFalse) {
ThrowWandException(magick_wand);
}
char *identify;
identify = MagickIdentifyImage (magick_wand);
//Never gets here
magick_wand = DestroyMagickWand(magick_wand);
MagickWandTerminus();
return(0);
}