if (job->external_surface) {
if (job->common->verbose)
fprintf(stderr, "%s: using existing GD image\n", job->common->cmdname);
- im = (gdImagePtr) (job->output_file);
+ im = (gdImagePtr) (job->surface);
} else {
if (truecolor_p) {
if (job->common->verbose)
job->common->cmdname, ROUND(job->width * job->height / 1024.));
im = gdImageCreate(job->width, job->height);
}
+ job->surface = (void *) im;
}
- job->surface = (void *) im;
if (!im) {
-#if 0
-/* FIXME - error function */
- agerr(AGERR, "gdImageCreate returned NULL. Malloc problem?\n");
-#endif
+ job->common->errorfn("gdImageCreate returned NULL. Malloc problem?\n");
return;
}
#ifdef MYTRACE
fprintf(stderr, "gdgen_end_graph (to file)\n");
#endif
+ job->surface = NULL;
}
}