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 567806 - Printer paper size keeps being reduced
Printer paper size keeps being reduced
Status: RESOLVED DUPLICATE of bug 559914
Product: GIMP
Classification: Other
Component: Plugins
2.6.4
Other Linux
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-14 22:55 UTC by Andrea
Modified: 2009-01-22 14:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andrea 2009-01-14 22:55:51 UTC
Please describe the problem:
After selecting certain paper sizes GIMP scales down the sizes whenever the Page Setup dialog is displayed.

This happens most of the time with printer specific paper sizes (i.e. not the ones valid for any printer).


Steps to reproduce:
1. Open a picture
2. Open the Page Setup
3. Select a printer (not any printer)
4. Select a paper size (e.g. photo 4x6) (sizes are correct)
5. Click Apply
6. Reopen page setup (sizes will have been scaled down)
7. repeat 6.

Actual results:
The sizes of the page are constantly scaled down e.g. for photo 4x6

1st) 101.6 x 152.4 (correct)
2nd) 53.6 x 35.8
3rd) 19 x 12.6
4th) 6.7 x 4.5
5th) 2.4 x 1.6


Expected results:
Page size stays at the initial selection.

Does this happen every time?
Always with some paper sizes, usually printer specific.
It does not happen with 2.4.7, but it happens with 2.6.3, 2.6.4.


Other information:
My setup is

Fedora 9
Gimp 2.6.3 (or 2.6.4)
CUPS 1.3.9
HPLIP 2.8.7
Printer HP Officejet j6410
Comment 1 Andrea 2009-01-14 23:04:14 UTC
Forgot to say:

1) GIMP honors those invalid sizes when printing. It actually uses the "next" values in the list, so that it is impossible to use the correct initial values

2) Starting from the 2nd access to Page Setup, the "Format for": field (initially set to the specific printer) is reverted to "Any printer", while the name of the format is kept (i.e. to a value that does not belong to "any printer").

3) Except for the first access, one does not need to click Apply, even Cancel triggers an other down scaling of the sizes.
Comment 2 Sven Neumann 2009-01-16 20:31:49 UTC
What version of GTK+ are you using? This works correctly for me and as all this is handled in GTK+ anyway, this is most likely a bug in GTK+ that has already been fixed.
Comment 3 Andrea 2009-01-16 21:17:30 UTC
This is GTK+'s rpm

gtk2-2.12.12-1.fc9.i386

I am not sure I understand correctly.
Is GTK+ in charge of the page size?
Other applications seem to work properly.
Comment 4 Sven Neumann 2009-01-17 13:41:35 UTC
Please upgrade to gtk+ 2.14 then and report back.
Comment 5 Andrea 2009-01-19 21:19:21 UTC
I've tried on Fedora 10 on a PS3.

gtk2-2.14.5-3.fc10.ppc64
gimp-libs-2.6.4-3.fc10.ppc

and the behavior is exactly the same.
The size of the page is scaled down each time I visit the Page Setup dialog.

I am a programmer myself and I can try to see what is going on since you cannot reproduce it.
Would you be able to give me a hint where to start from.
Comment 6 Andrea 2009-01-20 19:51:55 UTC
I've made some more investigations and the same happens (on Fedora 9, gimp 2.6.4) with different printers

HP OfficeJet J6410
HP Photosmart C6200
Canon BJC 8500

I've tried the photo size 6x4 inches.
Comment 7 Andrea 2009-01-20 23:02:27 UTC
I've tried to debug and I have changed in file print-page-setup.c

void
print_page_setup_dialog (GtkPrintOperation *operation)
{
  GtkPrintSettings *settings;
  GtkPageSetup     *setup;
  GError           *error = NULL;

  g_return_if_fail (GTK_IS_PRINT_OPERATION (operation));

  setup = gtk_print_operation_get_default_page_setup (operation);

  settings = gtk_print_settings_new ();

  gtk_page_setup_to_file(setup, "/tmp/p1.txt", &error); <<<<<<<<<<<<
  setup = gtk_print_run_page_setup_dialog (NULL, setup, settings);
  gtk_page_setup_to_file(setup, "/tmp/p2.txt", &error); <<<<<<<<<<<<

  g_object_unref (settings);

  gtk_print_operation_set_default_page_setup (operation, setup);
  gtk_page_setup_to_file(setup, "/tmp/p3.txt", &error); <<<<<<<<<<<<

  setup = gtk_print_operation_get_default_page_setup (operation);
  gtk_page_setup_to_file(setup, "/tmp/p4.txt", &error); <<<<<<<<<<<<
}

Everything semms ok, so that p2, p3, and p4 all contain the settings I've chosen.
But on the next call to this function, p1 is already broken.

There must be something else touching the GtkPageSetup between calls to print_page_setup_dialog()
Comment 8 Andrea 2009-01-21 19:42:14 UTC
I've tracked down the bug in

gtk_page_setup_new_from_key_file ()

called from 

print_page_setup_load() in print-page-setup.c

Somehow, the keyfile content is not loaded properly.

Do you know what function was used by gimp 2.4.7?
Comment 10 Andrea 2009-01-21 22:45:51 UTC
I think I've fixed it.

http://mail.gnome.org/archives/gtk-devel-list/2009-January/msg00104.html




It can only happens with certain page sizes if

"If ppd_name is not a recognized PPD paper name"

http://library.gnome.org/devel/gtk/stable/gtk-GtkPaperSize.html#gtk-paper-size-new-from-ppd
Comment 11 Michael Schumacher 2009-01-22 10:01:53 UTC
You should reassign this bug to GTK+, and attach your patch.
Comment 12 Andrea 2009-01-22 11:46:00 UTC
It has already been fixed on 03/12/2008.

Cheers
Comment 13 Michael Natterer 2009-01-22 14:59:53 UTC
Ok, thanks anyway for digging into it and re-finding the bug :)


*** This bug has been marked as a duplicate of 559914 ***