Commit 417bf199 authored by Jehan's avatar Jehan

Issue #4194: resolution passes from 300ppi to 72ppi after saving.

We are running gimp_image_set_imported_file() when saving, with NULL to
drop the tie with the imported file. Let's only change the default
resolutions when we actually set an imported file.

Also set the `resolution_set` flag even when it doesn't change the
current values (hence no undo or signals), for instance setting from 300
to 300 PPI. In such case, even though nothing changes, the resolution
has to still be considered as explicitly set.

In the reporter case, any one of these 2 fixes is enough.
See also commit fef9b1d2 (set to 72 PPI as default for imported files
only) and commit a8f552da (set imported file to NULL).
parent 79df3dd1
Pipeline #129641 passed with stages
in 24 minutes and 20 seconds
......@@ -2289,7 +2289,7 @@ gimp_image_set_imported_file (GimpImage *image,
gimp_object_name_changed (GIMP_OBJECT (image));
if (! private->resolution_set)
if (! private->resolution_set && file != NULL)
/* Unlike new files (which follow technological progress and will
* use higher default resolution, or explicitly chosen templates),
......@@ -2801,15 +2801,16 @@ gimp_image_set_resolution (GimpImage *image,
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
private->resolution_set = TRUE;
if ((ABS (private->xresolution - xresolution) >= 1e-5) ||
(ABS (private->yresolution - yresolution) >= 1e-5))
gimp_image_undo_push_image_resolution (image,
C_("undo-type", "Change Image Resolution"));
private->xresolution = xresolution;
private->yresolution = yresolution;
private->resolution_set = TRUE;
private->xresolution = xresolution;
private->yresolution = yresolution;
gimp_image_resolution_changed (image);
gimp_image_size_changed_detailed (image,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment