MVG autodetection failing in ImageMagick 6.5.0

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
paavo256

MVG autodetection failing in ImageMagick 6.5.0

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: MVG autodetection failing in ImageMagick 6.5.0

Post by magick »

Edit magic.xml and add
  • <magic name="MVG" offset="0" target="push graphic-context"/>
paavo256

Re: MVG autodetection failing in ImageMagick 6.5.0

Post by paavo256 »

Thanks, this did the trick. Strange that ImageMagick fails to detect its own format.

Best regards
Paavo
Post Reply