SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file access Error!" - Slackware

This is a discussion on SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file access Error!" - Slackware ; Hello, 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 ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file access Error!"

  1. SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file access Error!"

    Hello,

    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 :

    BJLSTART
    ControlMode=Common
    SetTime=20081009121951
    BJLEND
    BJFILTER ERROR :file access Error!
    not support this image format

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

    BJLSTART
    ControlMode=Common
    SetTime=20081009121951
    BJLEND
    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
    image.

    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
    (2008-02-29).

    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]%%
    %%[LastPage]%%
    ^D
    # 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
    0000012
    #

    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]%%
    %%[LastPage]%%

    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....

  2. Re: SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file accessError!

    On 10/09/2008 12:46 PM, Doff wrote:
    > Hello,
    >
    > 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.
    > ---------------
    > 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, 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....


    Switching to Slackware 12.1 I had a similar problem with gs and I
    solved it by removing -dSAFER. I didn't investigate on the cause as
    you did but I got to the solution looking at the similar commands in
    /usr/bin. "gslp and gslj"

    Ciao
    Giovanni
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

  3. Re: SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file access Error!

    In article , lsodgf0@home.net.it
    says...
    > On 10/09/2008 12:46 PM, Doff wrote:
    > Switching to Slackware 12.1 I had a similar problem with gs and I
    > solved it by removing -dSAFER. I didn't investigate on the cause as
    > you did but I got to the solution looking at the similar commands in
    > /usr/bin. "gslp and gslj"
    >
    > Ciao
    > Giovanni
    >


    Thanks for this, but, with slackware 12.1 (also), the gs output do not
    change :

    # gs -r600 -g4958x7016 -q -dNODISPLAY -dNOPROMPT -dSAFER -sDEVICE=ppmraw
    -sOutputFile=test.out smbprn.00001
    %%[ ProductName: GPL Ghostscript ]%%
    %%[Page: 1]%%
    %%[LastPage]%%
    # gs -r600 -g4958x7016 -q -dNODISPLAY -dNOPROMPT -sDEVICE=ppmraw -
    sOutputFile=test.out smbprn.00001
    %%[ ProductName: GPL Ghostscript ]%%
    %%[Page: 1]%%
    %%[LastPage]%%
    #

    Still have these lines on STDOUT that make the bjfilter fail afterwards
    :
    %%[ ProductName: GPL Ghostscript ]%%
    %%[Page: 1]%%
    %%[LastPage]%%





  4. Re: SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file access Error!

    In article , no.sp@Am.3rs says...
    > Hello,
    >
    > 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 :
    >
    > BJLSTART
    > ControlMode=Common
    > SetTime=20081009121951
    > BJLEND
    > BJFILTER ERROR :file access Error!
    > not support this image format
    >
    > I've modified a little the source code to understand why it complains :
    >
    > BJLSTART
    > ControlMode=Common
    > SetTime=20081009121951
    > BJLEND
    > 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
    > image.
    >
    > 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
    > (2008-02-29).
    >
    > 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]%%
    > %%[LastPage]%%
    > ^D
    > # 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
    > 0000012
    > #
    >
    > 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]%%
    > %%[LastPage]%%
    >
    > 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....
    >


    Well, affraid about nothing, I've tried to use another release of GS,
    the last one in fact (8.63), as on slack 12.1, it is v8.62.
    And.... the problem is still here.
    So, digging in the huge amount of sources line of GS, I had another idea
    : if the problem was given to GS, but not created by GS.....

    so, I've grabed the file received by samba (as a remote printer).
    It's a "PostScript document text conforming at level 3.0", created by
    the cups-windows print driver.
    And in the file, I've found the anoying string :

    statusdict begin (%%[ ProductName: ) print product print ( ]%%)= flush
    end

    and, at the end of the file :

    %%Pages: 1
    (%%[LastPage]%%) =
    %%EOF


    The first line appears on STDOUT and make the bjfilter fail. So, the
    printer driver has this in it !

    bjfilter is fine, gs is fine, bj-cups also.... Ok, I know now where to
    dig....

  5. Re: SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file access Error!

    In article , no.sp@Am.3rs says...
    > Well, affraid about nothing, I've tried to use another release of GS,
    > the last one in fact (8.63), as on slack 12.1, it is v8.62.
    > And.... the problem is still here.
    > So, digging in the huge amount of sources line of GS, I had another idea
    > : if the problem was given to GS, but not created by GS.....
    >
    > so, I've grabed the file received by samba (as a remote printer).
    > It's a "PostScript document text conforming at level 3.0", created by
    > the cups-windows print driver.
    > And in the file, I've found the anoying string :
    >
    > statusdict begin (%%[ ProductName: ) print product print ( ]%%)= flush
    > end
    >
    > and, at the end of the file :
    >
    > %%Pages: 1
    > (%%[LastPage]%%) =
    > %%EOF
    >
    >
    > The first line appears on STDOUT and make the bjfilter fail. So, the
    > printer driver has this in it !
    >
    > bjfilter is fine, gs is fine, bj-cups also.... Ok, I know now where to
    > dig....
    >



    ****.... this line "statusdict begin (%%[ ProductName: ) print product
    print ( ]%%)= flush end" comes from pscript5.dll


  6. Re: SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file access Error!

    On 2008-10-09, Doff wrote:

    > These drivers works fine with a printing from local application but, for
    > remote printing with samba and cups it has some troubles.


    You might want to look at LPRng, the "other" print appy. I don't know if it
    supports your printer, but if it does, I do know it is literally transparent
    with respect to samba and a Windows printer driver. I used it on a
    linux/windows network, using my slack box as a print server, and it let
    windows do it's thing with nary a peep. This was awhile back and I haven't
    configured my LAN thusly, lately, but it worked brilliantly. You may want
    to look into it. The newest kid on the block is not necessarilly the only
    solution.

    nb

  7. Re: SAMBA -> CUPS canon i560, GS and "BJFILTER ERROR :file access Error!

    In article , notbob@nothome.com
    says...
    > On 2008-10-09, Doff wrote:
    >
    > > These drivers works fine with a printing from local application but, for
    > > remote printing with samba and cups it has some troubles.

    >
    > You might want to look at LPRng, the "other" print appy. I don't know if it
    > supports your printer, but if it does, I do know it is literally transparent
    > with respect to samba and a Windows printer driver. I used it on a
    > linux/windows network, using my slack box as a print server, and it let
    > windows do it's thing with nary a peep. This was awhile back and I haven't
    > configured my LAN thusly, lately, but it worked brilliantly. You may want
    > to look into it. The newest kid on the block is not necessarilly the only
    > solution.
    >
    > nb


    Thanks, I'll have a look.
    Anyway, I've finaly succeded in printing with the Postscript driver from
    a windows PC to the linux cups server....

    I had to modifiy the bjfimage.c source code, in order to skip 37
    charaters that goes through GS.

    Here is a patch (if someone is interested) :

    --- bjfilter-2.4-0/src/bjfimage.c 2003-10-28 08:43:57.000000000 +
    0100
    +++ bjfilter-2.4-0a/src/bjfimage.c 2008-10-13 11:00:15.000000000 +
    0200
    @@ -97,6 +97,7 @@
    FILE *tf = NULL;
    unsigned char tbuf[10];
    short result = -1;
    + short cpt = 0;

    /*--- initialize image work parameter ---*/
    memset( (LPBJF_IMAGEINFO)lpbjfimage, 0, sizeof(BJF_IMAGEINFO) );
    @@ -106,7 +107,17 @@
    /*-------------------------------*/
    /*---- in case input is stdin ---*/
    if ( filename == NULL ){
    - if ( !fread( tbuf, 2, 1, stdin ) ) goto onErr;
    + fprintf(stderr, "Waiting header\n");
    + fread( tbuf, 1, 1, stdin );
    + /* quick hack : skip 37 chars (%%[ ProductName: GPL
    Ghostscript ]%%\n) of pscript5.dll */
    + while (( bufmatch( PPMRAWSTART, tbuf, 2) < 0 ) && (
    bufmatch( PNGSTART1, tbuf, 2) < 0 ) && ( cpt < 40 ))
    + {
    + fread( tbuf, 2, 1, stdin );
    + cpt++;
    + }
    + if ( cpt == 40 ) { fprintf(stderr,"header not found !
    \n"); }
    + else { fprintf(stderr,"header found at byte %i!
    \n",cpt); }

    /*-- not support bmp stdin, support png stdin --*/
    if ( bufmatch( PPMRAWSTART, tbuf, 2 ) > 0 ){


    It now works perfectly.
    I Still don't understand why this pscript5.dll have this "(%%[
    ProductName: GPL Ghostscript ]%%\n" going through ghostscript.

    Anyway, I've tried yesterday, and it works perfectly for printing.
    Bye.

+ Reply to Thread