From 7335dc8dc295f0d7b975478c3c25b4ee753244a0 Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 14 Dec 2016 00:55:58 +0100 Subject: [PATCH] Bug 776017 - Print resolution changes not taken in account... ... for second printing. Do not save in parasite the resolution used in the print plug-in when it is the image intended resolution. This allows to take into account changes of print resolution in successive printing. Only save it when different since one may have reasons and we should not interfere. --- plug-ins/print/print-settings.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plug-ins/print/print-settings.c b/plug-ins/print/print-settings.c index f39ec2d786..5fe9c006c4 100644 --- a/plug-ins/print/print-settings.c +++ b/plug-ins/print/print-settings.c @@ -81,12 +81,20 @@ print_settings_save (PrintData *data) /* image setup */ if (gimp_image_is_valid (data->image_id)) { + gdouble xres; + gdouble yres; + + gimp_image_get_resolution (data->image_id, &xres, &yres); + g_key_file_set_integer (key_file, "image-setup", "unit", data->unit); - g_key_file_set_double (key_file, "image-setup", - "x-resolution", data->xres); - g_key_file_set_double (key_file, "image-setup", - "y-resolution", data->yres); + if (xres != data->xres || yres != data->yres) + { + g_key_file_set_double (key_file, "image-setup", + "x-resolution", data->xres); + g_key_file_set_double (key_file, "image-setup", + "y-resolution", data->yres); + } g_key_file_set_double (key_file, "image-setup", "x-offset", data->offset_x); g_key_file_set_double (key_file, "image-setup",