[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gv] gv fails when fed via pipe
From: |
Nuno Silva |
Subject: |
Re: [bug-gv] gv fails when fed via pipe |
Date: |
Mon, 5 May 2014 10:23:44 +0300 |
User-agent: |
Mutt/1.5.22 (2013-10-16) |
On Mon, May 05, 2014 at 10:09:18AM +0300, Nuno Silva wrote:
> On Sun, May 04, 2014 at 12:28:42PM -1000, Paul Wessel wrote:
> > Hi list-
> >
> > I have noticed that gv often crashes when a process writes PostScript
> > directly to it via a pipe while the same PostScript, if first saved to
> > a file, opens fine. These cases always involves the image operator.
> > We _think_ we are writing the PS correctly as it works in all other
> > contexts except the piping via gv.
> >
> > Attached is a small example (issue.ps) that demonstrates the
> > issue. For instance,
> >
> > gv issue.ps [works fine]
> > gv - < issue.ps [gives errors]
> >
> > I am using gv version 3.7.4 installed via macports on OSX 10.9.2.
>
> I can reproduce this with gv 3.7.3 on Gentoo GNU/Linux. I also did some
> quick tests with other tools that (AFAIK) use ghostscript internally,
> and they did *not* have this issue: convert (imagemagick), ps2pdf.
>
>
> $ convert - issue.png < issue.ps
>
> $ ps2pdf - issue.pdf < issue.ps
>
> I did also try with ghostscript as well, and it worked:
>
> $ gs -q -sPAPERSIZE=a4 -dBATCH -dNOPAUSE -sDEVICE=ps2write \
> -sOutputFile=out.ps - < issue.ps
>
>
> Converting PDF files with images to postscript, and then invoking gv in
> the same way on the resulting postscript files seems to trigger some
> error as well.
Looking at the code of the release of gv I am using, I see the comment
in line 1443[0] of src/Ghostview.c, explaining why gv does not pass "-" to
ghostscript.
[0] after
'if (gvw->ghostview.filename && !strcmp(gvw->ghostview.filename,"-")) {'
In fact, if I call gs without "-", the image does *not* get
converted. If I omit -dBATCH, I will get a ghostscript error as well.
$ gs -sPAPERSIZE=a4 -dNOPAUSE -sDEVICE=ps2write -sOutputFile=out.ps \
< issue.ps
I don't know enough about ghostview or ghostscript, so I have no idea if
this can be fixed or not.
--
Nuno Silva (aka njsg)