Date: Thu, 9 Oct 2008 12:46:16 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
Lines: 106
Organization: Guest of ProXad - France
NNTP-Posting-Date: 09 Oct 2008 12:46:16 MEST
X-Trace: 1223549176 news-3.free.fr 11829
X-Complaints-To: abuse@proxad.net
Bytes: 4198
To: slackware@ecartis.ausics.net
X-Gateway-From: fox.ausics.net


I was trying to print on a Canon i560 printer with Cups and Samba.
To set up the printer drivers, I've used the bjfilter-cups and bjfilter
located on the japan ftp site.
These drivers works fine with a printing from local application but, for
remote printing with samba and cups it has some troubles.

What I've been facing is the simple "not support this image format" in
the logs, and no output to the printer.

So, I've done some debugging, and here is what I've found :

The samba server receive the file to print created by the postscipt
driver. The samba server grab the STDIN to pass it through a pstops
filter, then it goes to gs, then to the bjfilterpixusi560.

Every thing goes fine until ghostscript processing.... that produce this
"not support this image format".

In fact, the file created by the windows driver and sent to samba is a
"PostScript document text conforming at level 3.0". So everythings ok.
Manually passing to gs is ok :

this is the command line cups builds to print :
gs -r600 -g4958x7016 -q -q -dNODISPLAY -dNOPROMPT -dSAFER -
sDEVICE=ppmraw -sOutputFile=- -

and pipe it to :

/usr/local/bin/bjfilterpixus560i --imageres 600 --papersize a4 --media
plain --paperload asf --bbox 9,14,585,834

So the complete action would be (done manualy) :

cat smbprn.00001 | gs -r600 -g4958x7016 -q -q -dNODISPLAY -dNOPROMPT -
dSAFER -sDEVICE=ppmraw -sOutputFile=- - |
usr/local/bin/bjfilterpixus560i --imageres 600 --papersize a4 --media
plain --paperload asf --bbox 9,14,585,834

and then it says :

BJFILTER ERROR :file access Error!
not support this image format

I've modified a little the source code to understand why it complains :

tbuf read is : %%
BJFILTER ERROR :file access Error!
not support this image format PNGSTART1 (bjfimage.c:126)

You can see that the input of the bjfilter is not recognized as a PNG

In fact, the bjfilter tries to see if the input is a ppm or png input.
(by matching the header of the file against PPMRAWSTART, PNGSTART1 and
PNGSTART2, defined in src/bjfimage.h)

So, I've tried to do all the steps manually, to see where it can fail.

and the failure is due to GS !!!! I'm using GS GPL Ghostscript 8.62

And, when converting a document, with this command line :

# gs -r600 -g4958x7016 -q -dNODISPLAY -dNOPROMPT -dSAFER -sDEVICE=ppmraw
-sOutputFile=test.out smbprn.00001
%%[ ProductName: GPL Ghostscript ]%%
%%[Page: 1]%%
# file test.out
test.out: Netpbm PPM "rawbits" image data

So, the file generated by GS is perfectly fine, even a header check is
ok :
# head -10c test.out | od -x
0000000 3650 230a 4920 616d 6567

So, why is there an error ?
Just, because GS can not be QUIET !
The output is redirected to bjfilter via the pipe (see some line up).
But, GS is saying :

%%[ ProductName: GPL Ghostscript ]%%
%%[Page: 1]%%

just at the beginning of his work, and then, send this to bjfilter !!!!!
and something that is starting by "%%" is obviously not an image.....

So, I know from where comes the error, but, now, I don't know how to say
to GS to be quiet !!!!

If anyone has an idea....