On my Debian 9.4 Linux ("Stretch"), I can print from virtually every program, certainly from Chrome, Libreoffice, emacs, okular and via lpr. However, I cannot print from gimp.

The printer is a Brother DCP-L2500D USB printer. Printing is done with CUPS.

When printing from gimp I get an error message in /var/log/cups/error_log

Can't use an undefined value as a subroutine reference at /usr/lib/cups/filter/brother_lpdwrapper_DCPL2500D line 565.

The file in question is a humble perl script and the error is located in a function check_custom_paper(). In there it tries to find a unitfunc, by traversing a hash. The values relevant at this point are

When printing from gimp

$ppdcust                  = "Custom.a4"
$lpr_options_ref->{'-pt'} = "CUSTOM0"

When printing with lpr

$ppdcust                  = (null)
$lpr_options_ref->{'-pt'} = "A4"

When I look at the script, it is obvious to me, that with the gimp values, it will not find a unitfunc. When it then later calls this (undefined) function, it produces the error above.

Now, one might say that Brother produced a shitty perl script. But then I would expect to see some complaints on the net, which I do not see. I reinstalled the printer driver today and it was the same version I had installed years ago. Again, one might say, that Brother not only writes shitty perl scripts, but also doesn't fix them.

What's haunting me is that printing mostly works. Even the scanner part of my printer works. So the culprit might as well be gimp and that Custom.a4 and CUSTOM0 are values, that a well-behaved program should not pass to CUPS.

I also tried to install gutenprint, but that only made things worse: I could no longer print at all.

  • Does anybody have an idea, why gimp and my Brother printer are at odds with each other?
  • I gave gutenprint another try and this time it didn't blow anything and Gimp's"Print with Gutenprint.." actually printed the picture. Strangely, when setting the print options it presented me a printer I had years ago. The normal "Print .." still doesn't work. Apr 14, 2019 at 10:19

1 Answer 1


Sorry for asking a question that is not quite worthy of StackExchange. But before somebody puts actual work in it, here is the solution to the problem:

I finally did the obvious thing and moved the entire ~/.gimp-2.8 directory out of the way. Eh voila - printing works.

Gimp repopulated this directory with new files and in order to find the culprit, I reinstated my old files and set out to replace each file in there by a new file, one by one.

I was immediately suspicious of a file called print-page-setup. First, it obviously has something to do with printing and second, it contained a line PPDName=a4 while the new file had PPDName=A4 in it and I had already seen this lowercase a4 as part of the $ppdcust value when debugging brother_lpdwrapper_DCPL2500D (see my original problem description)

Replacing print-page-setup in ~/.gimp-2.8 did it. Silly me!

However, I still don't know how that value got in there in the first place, but who cares.

  • Broken stuff and how it got fixed seems very valid to me. If it hasn't happened to you, you haven't tried many things yet. I would just suggest a workaround for similar problems: sometimes using Print to file will get you a printable file that you can manually pass to lp or lpr.
    – Joe
    Apr 20, 2019 at 5:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .