After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776017 - Print definition changes not taken in account for 2nd printing
Print definition changes not taken in account for 2nd printing
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.8.18
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2016-12-12 21:34 UTC by Ofnuts
Modified: 2016-12-20 15:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a "Load Defaults" button. (4.74 KB, patch)
2016-12-13 23:43 UTC, Jehan
none Details | Review
Add a "Load Defaults" button. (2.60 KB, patch)
2016-12-13 23:46 UTC, Jehan
none Details | Review
Additional patch: do not save print plug-in resolution when same as print size resolution (1.87 KB, patch)
2016-12-14 00:05 UTC, Jehan
none Details | Review

Description Ofnuts 2016-12-12 21:34:10 UTC
* Load an image, set the print definition to X PPI, and print the image. It prints at the expected size.
* Image>Print definition, set the print definition to Y PPI, and print again: the image is still printed at X PPI.
* Save the image and reload (Save+File>Revert can be enough) and print again. The image is now printed at Y PPI.
* Without saving, reload/revert the image and set definition to Z PPI, printing is done at Z PPI.

TL;DR: the print definition used for the first print sticks forever until the image is reloaded.
Comment 1 Jehan 2016-12-13 22:15:24 UTC
I confirm.

The issue comes from the fact that the print plugin saves on the image various settings serialized into a parasite. And these settings override the print resolution.
So when you printed once, the resolution previously chosen in the print dialog is always chosen over the resolution chosen in the print size dialog.

The solution would be to not save the resolution from the print plugin. But then some people might get annoyed by the fact their change in this dialog is not saved across their successive printing.

Another idea could be to sync the resolution in the print plugin and the print size dialog. But then some people may want to have a different size on purpose (because maybe they print at home for tests with some specific resolution, but the printshop will print with another resolution on another size of paper).

So I don't see a perfect choice which fits all.
Comment 2 Jehan 2016-12-13 22:15:49 UTC
P.S.: that was confirmed in master branch too, by the way.
Comment 3 Jehan 2016-12-13 22:37:53 UTC
Oh and by the way, the reason why when you close/reload the image, it uses the set resolution again is because the parasite is not a persistent one.
Comment 4 Jehan 2016-12-13 23:43:15 UTC
Created attachment 341922 [details] [review]
Add a "Load Defaults" button.

So I was thinking a little more on this. What if instead of changing the current behavior, we add a "Load Defaults" button. This way, you can still play with resolution in the print plug-in without touching the main print resolution (from print size dialog) and have this value reused across successive printings.

Yet you can reset to intended print resolution (or updated resolution) at any time.
Patch attachedl
Comment 5 Jehan 2016-12-13 23:46:25 UTC
Created attachment 341923 [details] [review]
Add a "Load Defaults" button.

Argh! There was some updated icon from completely unrelated in-progress attempts in the previous patch. Updated.
Comment 6 Jehan 2016-12-14 00:05:00 UTC
Created attachment 341924 [details] [review]
Additional patch: do not save print plug-in resolution when same as print size resolution

A second complementary patch: we should not save the print plugin resolution in-parasite when it is same as the print size one (basically when the user never changed it explicitly).

On second thoughts, this may actually be enough to have this bug considered as fixed. But I think the first patch is complementary and also useful as well since you may have reasons to tweak your resolution, then later come back to your defaults.
Comment 7 Ofnuts 2016-12-14 01:41:47 UTC
>Another idea could be to sync the resolution in the print plugin and the print >size dialog. But then some people may want to have a different size on purpose >(because maybe they print at home for tests with some specific resolution, but >the printshop will print with another resolution on another size of paper).

Let's not invent weird use cases that prevent the standard ones to work. The dialog is called Image>Print size, and it ought to change the print size *now* as well as set the same print definition in exported files, and change the pixel/measurement unit ratio in the cursor position indicator and the Measure tool. 

One print size, easy to understand. If it works as advertised/expected it is always possible to change the actual print size when necessary.
Comment 8 Jehan 2016-12-14 01:53:05 UTC
I don't get your comment. What is the weird use case?

> One print size, easy to understand. […] the actual print size

So should there be *one* print size or an "actual" print size (and another "non-actual" one then?)? Sorry I really don't understand your comment.

> If it works as advertised/expected

I don't think there is anything advertised here. Could you tell me what you expect? :-)
Comment 9 Ofnuts 2016-12-14 09:34:44 UTC
"This way, you can still play with resolution in the print plug-in without touching the main print resolution (from print size dialog)"

Doesn't this imply that there are several values of the "print definition" that exist at the same time?

Or should we have two clearly defined concepts:

1) an image definition, used by the Measure tool and the cursor position indicator, saved in the PNG/JPG metadata. 
2) a print definition (used exclusively for print) which is by default the one above.

But that would require a whole new dialog to set them independently...
Comment 10 Jehan 2016-12-14 13:39:13 UTC
Right now there are indeed 2 separate print resolutions: the one set into the image, and the one actually used in the print dialog. The later defaults on the same value, but can later be changed without actually affecting the former. I agree this is weird at first, but then I can easily imagine use cases where you have an expected (optimal) print resolution whereas you print sometimes at other sizes (hence resolution).

Also the resolution in the print dialog can get updated automatically, for instance if your image doesn't fit on a given paper format (therefore it would "compress" the image at higher resolution). We certainly don't want to have the main resolution get updated automatically this way without the creator noticing.

> But that would require a whole new dialog to set them independently...

Well there are already 2 dialogs to set them independently.
Comment 11 Ofnuts 2016-12-14 21:03:06 UTC
> Well there are already 2 dialogs to set them independently.

Oh, never noticed that background tab in the print dialog. Makes sense now...
Comment 12 Jehan 2016-12-20 15:27:45 UTC
Ok I pushed like this:

- We save in-parasite the print resolution only if it is different from the one in the "Print Size" dialog (i.e. only when the user explicitly modified it in the "Image Settings" tab of the print dialog). This way, when you leave everything as default, any update to Print Size dialog is taken into account in the next prints.

- There is now a "Load Defaults" button in the "Image Settings" tab of the print dialog to be able to easily revert to the set "Print Size", making printing tests easier as well as making it obvious that these are 2 different values.

commit 4827116ac989c7a91f2586bd0c61570b5c697e22
Author: Jehan <jehan@girinstud.io>
Date:   Wed Dec 14 00:33:04 2016 +0100

    plug-ins: add a "Load Defaults" button to reset print resolution...
    
    ... in the print plug-in.
    The resolution set during printing may be different from the print size,
    for various reason (home printing vs. printshop for instance). The print
    plug-in's resolution is saved and reused from a non-persistent parasite,
    thus masking actual intended print resolution. Adding this button allows
    to reset this temporary value to the intended resolution at any time.

commit 7335dc8dc295f0d7b975478c3c25b4ee753244a0
Author: Jehan <jehan@girinstud.io>
Date:   Wed Dec 14 00:55:58 2016 +0100

    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.


commit 0cdca57d126f2714d761e3e3dcd663722e6fda47
Author: Jehan <jehan@girinstud.io>
Date:   Tue Dec 20 04:07:45 2016 +0100

    plug-ins: use an epsilon to compare double values.
    
    Also take into account the case when the minimum possible print
    resolution is higher than the expected image resolution. We don't want
    to remember the print resolution if it is this lower value either.
    See commit 7335dc8.