[magick-users] Segfault and Ghostscript error when using
MagickReadImageBlob() on an EPS file
Ian Stevens
istevens.list at gmail.com
Fri Feb 22 19:59:33 PST 2008
I'm trying to load an EPS image into a MagickWand by way of
MagickReadImageBlob() and keep getting segfaults with a Ghostscript error:
Error: /ioerror in --run--
Operand stack:
--nostringval-- --nostringval-- (/set)
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval-- false 1 %stopped_push 1813 1 3 %oparray_pop
--nostringval--
Dictionary stack:
--dict:1091/1123(ro)(G)-- --dict:0/20(G)-- --dict:70/200(L)--
Current allocation mode is local
Last OS error: 21
GPL Ghostscript 8.57: Unrecoverable error, exit code 1
On Mac OS using ImageMagick 6.3.5 from Fink, this is followed by many
repetitions of:
Warning: recursive semaphore lock detected!
Under Debian Linux etch, the process segfaults without the above message.
On both platforms, the temp directory is filled with hundreds of magick
files.
No such error occurs when I use convert on the same EPS file.
Here's some sample source code which replicates the error:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wand/magick_wand.h>
int main(int argc,char **argv)
{
char eps[] = "%!PS-Adobe-3.0 EPSF-3.0\n%%Origin: 0 0\n%%BoundingBox: 100
100 200 200\nnewpath\n100 100 moveto\n0 100 rlineto\n100 0 rlineto\n0 -100
rlineto\n-100 0 rlineto\nclosepath\ngsave\n0 0 0.4 setrgbcolor\nfill";
MagickBooleanType status;
MagickWand *magick_wand;
magick_wand = NewMagickWand();
status = MagickReadImageBlob(magick_wand, eps, strlen(eps));
if(status == MagickFalse)
printf("Status: %d", status);
magick_wand = DestroyMagickWand(magick_wand);
return(0);
}
Any help would be appreciated.
thanks,
Ian.
More information about the Magick-users
mailing list