Hello, my plugin performs a series of image algorithms and provides a GimpDrawablePreview widget. One of those operations works by adding a new layer to the image, I have no problems when apply it to the "real" image... but things changes if I try to show a preview of it. Basically, the algorithm is the following: /* ----------------- */ // double the region int new_layer = gimp_layer_new_from_drawable (drawable->drawable_id, gimp_drawable_get_image (drawable->drawable_id)); // pixel operation on the original layer/drawable.... // apply changes if (preview) { gimp_drawable_preview_draw_region (GIMP_DRAWABLE_PREVIEW (preview), dst_rgn); } else { gimp_drawable_flush (drawable); gimp_drawable_merge_shadow (drawable->drawable_id, undo); gimp_drawable_update (drawable->drawable_id, dst_rgn->x, dst_rgn->y, dst_rgn->w, dst_rgn->h); } // set new layer's mode gimp_layer_set_mode (drawable->drawable_id, GIMP_DIFFERENCE_MODE); // add the layer and merge gimp_image_add_layer (gimp_drawable_get_image (drawable->drawable_id), new_layer, 1); int new_drawable = gimp_image_merge_visible_layers(gimp_drawable_get_image (drawable->drawable_id), GIMP_CLIP_TO_IMAGE); /* ----------------- */ Problem is at the last line, when executed it says "tried reading from drawable 30 which was removed from the image (killing)"... but only in preview mode. I guess that drawables in a preview widget must be managed in a different way... but how? Is there an example of plugin that uses layers plus a preview window? Thanks! _______________________________________________ gimp-developer-list mailing list List address: gimp-developer-list@xxxxxxxxx List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list