mirror of https://github.com/GNOME/gimp.git
Issue #4068: default pixel density should be 72.0 for loaded images.
New images should obviously still default to the template pixel density (defaulting to 300.0 PPI when no specific template is selected). Loaded images though should use a more conservative default of 72 PPI, first because this is what other software defaults to when no density is set (so we should keep consistent when possible), and this is also what the Exif standard (I checked both last version 2.32, and older 2.3) recommends when no resolution is set. Technically we differentiate a loaded from a newly created image by whether or not an imported_file has been set. Of course, any explicitly set resolution will always override whatever default.
This commit is contained in:
parent
30e7be6db1
commit
fef9b1d2a3
|
@ -45,6 +45,7 @@ struct _GimpImagePrivate
|
|||
gdouble xresolution; /* image x-res, in dpi */
|
||||
gdouble yresolution; /* image y-res, in dpi */
|
||||
GimpUnit resolution_unit; /* resolution unit */
|
||||
gboolean resolution_set; /* resolution explicitly set */
|
||||
GimpImageBaseType base_type; /* base gimp_image type */
|
||||
GimpPrecision precision; /* image's precision */
|
||||
GimpLayerMode new_layer_mode; /* default mode of new layers */
|
||||
|
|
|
@ -723,6 +723,7 @@ gimp_image_init (GimpImage *image)
|
|||
private->height = 0;
|
||||
private->xresolution = 1.0;
|
||||
private->yresolution = 1.0;
|
||||
private->resolution_set = FALSE;
|
||||
private->resolution_unit = GIMP_UNIT_INCH;
|
||||
private->base_type = GIMP_RGB;
|
||||
private->precision = GIMP_PRECISION_U8_NON_LINEAR;
|
||||
|
@ -2287,6 +2288,24 @@ gimp_image_set_imported_file (GimpImage *image,
|
|||
{
|
||||
gimp_object_name_changed (GIMP_OBJECT (image));
|
||||
}
|
||||
|
||||
if (! private->resolution_set)
|
||||
{
|
||||
/* Unlike new files (which follow technological progress and will
|
||||
* use higher default resolution, or explicitly chosen templates),
|
||||
* imported files have a more backward-compatible value.
|
||||
*
|
||||
* 72 PPI is traditionnally the default value when none other had
|
||||
* been explicitly set (for instance it is the default when no
|
||||
* resolution metadata was set in Exif version 2.32, and below,
|
||||
* standard). This historical value will only ever apply to loaded
|
||||
* images. New images will continue having more modern or
|
||||
* templated defaults.
|
||||
*/
|
||||
private->xresolution = 72.0;
|
||||
private->yresolution = 72.0;
|
||||
private->resolution_unit = GIMP_UNIT_INCH;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2788,8 +2807,9 @@ gimp_image_set_resolution (GimpImage *image,
|
|||
gimp_image_undo_push_image_resolution (image,
|
||||
C_("undo-type", "Change Image Resolution"));
|
||||
|
||||
private->xresolution = xresolution;
|
||||
private->yresolution = yresolution;
|
||||
private->xresolution = xresolution;
|
||||
private->yresolution = yresolution;
|
||||
private->resolution_set = TRUE;
|
||||
|
||||
gimp_image_resolution_changed (image);
|
||||
gimp_image_size_changed_detailed (image,
|
||||
|
|
Loading…
Reference in New Issue