Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 36201) +++ trunk/src_plugins/export_png/png.c (revision 36202) @@ -110,7 +110,7 @@ int w, h; /* in pixels */ int dpi, xmax, ymax; color_struct *black, *white; - gdImagePtr comp_im, erase_im; + gdImagePtr master_im, comp_im, erase_im; } rnd_png_t; static rnd_png_t pctx_, *pctx = &pctx_; @@ -145,7 +145,7 @@ int is_erase; } hid_gc_t; -static gdImagePtr im = NULL, master_im; +static gdImagePtr im = NULL; static FILE *f = 0; static int linewidth = -1; static int lastgroup = -1; @@ -624,9 +624,9 @@ free(pctx->white); free(pctx->black); - if (master_im != NULL) { - gdImageDestroy(master_im); - master_im = NULL; + if (pctx->master_im != NULL) { + gdImageDestroy(pctx->master_im); + pctx->master_im = NULL; } if (pctx->comp_im != NULL) { gdImageDestroy(pctx->comp_im); @@ -720,7 +720,7 @@ gdImageSetResolution(im, pctx->dpi, pctx->dpi); #endif - master_im = im; + pctx->master_im = im; /* Allocate white and black; the first color allocated becomes the background color */ pctx->white = (color_struct *)malloc(sizeof(color_struct)); Index: trunk/src_plugins/export_png/png_photo2.c =================================================================== --- trunk/src_plugins/export_png/png_photo2.c (revision 36201) +++ trunk/src_plugins/export_png/png_photo2.c (revision 36202) @@ -222,7 +222,7 @@ rgb(&black, 0, 0, 0); rgb(&fr4, 70, 70, 70); - im = master_im; + im = pctx->master_im; ts_bs(photo_copper[photo_groups[0]]); if (photo_silk != NULL)