Page 1 of 1

MVG autodetection failing in ImageMagick 6.5.0

Posted: 2009-04-13T07:12:22-07:00
by paavo256
With an earlier ImageMagick version, the equivalent of the following worked:

Code: Select all

char* block = malloc(size);
strcpy(block, "push graphic-context\n viewbox 0 0 ...
Magick::Blob blob;
blob.updateNoCopy(block, size, Magick::Blob::MallocAllocator); 
Magick::Image image;
image.read(blob);
Now in version 6.5.0 I get an error: ImageMagick: NoDecodeDelegateForThisImageFormat `' @ blob.c/BlobToImage/344

However, if I save the content in a temporary .mvg file and read the content from the file, everything works. It seems it is no longer able to autodetect MVG format in a blob. I know I could force the format by calling image.magick("mvg") before the reading, but in the real app the image reading part does not have the format knowledge at hand.

Thanks
Paavo

Re: MVG autodetection failing in ImageMagick 6.5.0

Posted: 2009-04-13T09:14:56-07:00
by magick
Edit magic.xml and add
  • <magic name="MVG" offset="0" target="push graphic-context"/>

Re: MVG autodetection failing in ImageMagick 6.5.0

Posted: 2009-04-14T03:59:42-07:00
by paavo256
Thanks, this did the trick. Strange that ImageMagick fails to detect its own format.

Best regards
Paavo