GNOME Bugzilla – Bug 567806
Printer paper size keeps being reduced
Last modified: 2009-01-22 14:59:53 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
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.
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.
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.
Please upgrade to gtk+ 2.14 then and report back.
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.
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.
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()
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?
http://svn.gnome.org/viewvc/gimp/branches/gimp-2-4/plug-ins/print/
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
You should reassign this bug to GTK+, and attach your patch.
It has already been fixed on 03/12/2008. Cheers
Ok, thanks anyway for digging into it and re-finding the bug :) *** This bug has been marked as a duplicate of 559914 ***