core: Fix crash when filling with Middle Gray color

Filling with Middle Gray requires getting the image format
for conversion from CIE Lab. This works when filling a layer,
but new images are not yet available in the context.
This adds the image to the context before gimp_drawable_fill ()
is called so it has access to the image format.
This commit is contained in:
Alx Sa 2023-07-12 01:59:38 +00:00
parent 27f18ff872
commit caff8dbb7b
1 changed files with 1 additions and 0 deletions

View File

@ -112,6 +112,7 @@ gimp_image_new_from_template (Gimp *gimp,
gimp_template_get_base_type (template),
gimp_template_get_precision (template),
FALSE);
gimp_context_set_image (context, image);
gimp_image_undo_disable (image);