I created a fix and tested it successfully:

Breakpoint 2, add_cups_options (key=0x7fe101636ca0 "cups-PageSize", 
value=0x7fe101636c80 "Custom.595.28x841.89", 
    user_data=0x7fe1014c6970) at 
/home/all/SourceCode/gtk/gtk+3.0-3.4.2/./modules/printbackends/cups/gtkprintbackendcups.c:521
521     {
(gdb) c
Continuing.

Breakpoint 3, add_cups_options (key=0x7fe101636ca5 "PageSize", value=<optimized 
out>, user_data=<optimized out>)
    at 
/home/all/SourceCode/gtk/gtk+3.0-3.4.2/./modules/printbackends/cups/gtkprintbackendcups.c:566
566       if (custom_value && !g_str_has_prefix(value, "Custom."))
(gdb) n
573         gtk_cups_request_encode_option (request, key, value);
(gdb) c
Continuing.

The fix simply checks whether the value already has the "Custom." prefix
and if so, doesn't insert it again. In the code above the test
!g_str_has_prefix(value, "Custom.") fails and processing goes through
the 'else' clause on line 573.

-  /* Add "Custom." prefix to custom values. */
-  if (custom_value)
+  /* Add "Custom." prefix to custom values (if they don't already have the 
prefix). */
+  if (custom_value && !g_str_has_prefix(value, "Custom."))

A debdiff (for Precise) is attached.

** Patch added: "Precise debdiff - gtk+3.0 - do not duplicate CUPS "Custom.""
   
https://bugs.launchpad.net/ubuntu/precise/+source/gtk+3.0/+bug/998156/+attachment/3239331/+files/gtk%2B3.0_3.4.2-0ubuntu0.5%7Eppa%7Etj.debdiff

** Changed in: gtk+3.0 (Ubuntu Precise)
     Assignee: TJ (intuitivenipple) => (unassigned)

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gimp in Ubuntu.
https://bugs.launchpad.net/bugs/998156

Title:
  GTK Print dialog sends broken custom page size attribute:
  "PageSize=Custom.Custom.<width>x<length>"

Status in GTK+ GUI Toolkit:
  New
Status in “firefox” package in Ubuntu:
  Confirmed
Status in “gimp” package in Ubuntu:
  Confirmed
Status in “gtk+3.0” package in Ubuntu:
  Confirmed
Status in “inkscape” package in Ubuntu:
  Confirmed
Status in “firefox” source package in Precise:
  Confirmed
Status in “gimp” source package in Precise:
  Confirmed
Status in “gtk+3.0” source package in Precise:
  In Progress
Status in “inkscape” source package in Precise:
  Confirmed
Status in “firefox” source package in Quantal:
  Confirmed
Status in “gimp” source package in Quantal:
  Confirmed
Status in “gtk+3.0” source package in Quantal:
  Confirmed
Status in “inkscape” source package in Quantal:
  Confirmed
Status in “gtk+2.0” package in Debian:
  Unknown

Bug description:
  When trying to print a photo, the printer stops with status "rendering
  completed". I have to remove all printing jobs and restart CUPS to be
  able to print again. This error does not occur when printing other
  documents, i.e. simple text.

  I use a HP PhotoSmart b109a connected to a Fritz!Box 7390 wireless
  router ("socket://fritz.box:9100").

  This bug is also present in Debian: http://bugs.debian.org/cgi-
  bin/bugreport.cgi?bug=664031

To manage notifications about this bug go to:
https://bugs.launchpad.net/gtk/+bug/998156/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to