diff --git a/app/pdb/image-cmds.c b/app/pdb/image-cmds.c index 4270b2d4a2..9dcd1e0b48 100644 --- a/app/pdb/image-cmds.c +++ b/app/pdb/image-cmds.c @@ -4660,7 +4660,7 @@ register_image_procs (GimpPDB *pdb) "Checks if the image has unsaved changes.", "This procedure checks the specified image's dirty count to see if it needs to be saved. Note that saving the image does not automatically set the dirty count to 0, you need to call [method@Gimp.Image.clean_all] after calling a save procedure to make the image clean.\n" "\n" - "When loading an image using e.g. [func@Gimp.file_load] the image will be marked as clean, but loading an image calling directly the accurate file format procedure may return a dirty image.", + "When loading an image using e.g. [func@Gimp.file_load], or when created by a [class@Gimp.LoadProcedure], the image will be marked as clean. In other cases, it may sometimes be useful to clean programmatically created image yourself.", NULL); gimp_procedure_set_static_attribution (procedure, "Spencer Kimball & Peter Mattis", diff --git a/libgimp/gimpimage_pdb.c b/libgimp/gimpimage_pdb.c index 486a97a81a..54c5d7bfe1 100644 --- a/libgimp/gimpimage_pdb.c +++ b/libgimp/gimpimage_pdb.c @@ -2086,9 +2086,10 @@ gimp_image_clean_all (GimpImage *image) * [method@Gimp.Image.clean_all] after calling a save procedure to make * the image clean. * - * When loading an image using e.g. [func@Gimp.file_load] the image - * will be marked as clean, but loading an image calling directly the - * accurate file format procedure may return a dirty image. + * When loading an image using e.g. [func@Gimp.file_load], or when + * created by a [class@Gimp.LoadProcedure], the image will be marked as + * clean. In other cases, it may sometimes be useful to clean + * programmatically created image yourself. * * Returns: TRUE if the image has unsaved changes. **/ diff --git a/libgimp/gimploadprocedure.c b/libgimp/gimploadprocedure.c index 86bfc700ae..faf338322c 100644 --- a/libgimp/gimploadprocedure.c +++ b/libgimp/gimploadprocedure.c @@ -284,6 +284,13 @@ gimp_load_procedure_run (GimpProcedure *procedure, if (image != NULL && metadata != NULL && flags != GIMP_METADATA_LOAD_NONE) _gimp_image_metadata_load_finish (image, NULL, metadata, flags); + if (image) + { + gimp_image_clean_all (image); + gimp_image_undo_disable (image); + gimp_image_undo_enable (image); + } + /* This is debug printing to help plug-in developers figure out best * practices. */ diff --git a/pdb/groups/image.pdb b/pdb/groups/image.pdb index d5bdc02f98..3cfb564aa7 100644 --- a/pdb/groups/image.pdb +++ b/pdb/groups/image.pdb @@ -1799,9 +1799,10 @@ set the dirty count to 0, you need to call [method@Gimp.Image.clean_all] after calling a save procedure to make the image clean. -When loading an image using e.g. [func@Gimp.file_load] the image will be -marked as clean, but loading an image calling directly the accurate file -format procedure may return a dirty image. +When loading an image using e.g. [func@Gimp.file_load], or when created +by a [class@Gimp.LoadProcedure], the image will be marked as clean. +In other cases, it may sometimes be useful to clean programmatically +created image yourself. HELP &std_pdb_misc;