This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 150722 - evince refuses to display valid PostScript files
evince refuses to display valid PostScript files
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: evince (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Marco Pesenti Gritti
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-09 17:39 EST by Michal Jaegermann
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-31 06:34:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Desktop 306020 None None None Never

  None (edit)
Description Michal Jaegermann 2005-03-09 17:39:52 EST
Description of problem:

For example:

$ evince /usr/share/ghostscript/7.07/examples/snowflak.ps

produces only an alert "Unable to open document".

Version-Release number of selected component (if applicable):
evince-0.1.7-1

How reproducible:
Always
Comment 1 Marco Pesenti Gritti 2005-03-12 07:53:41 EST
gv works, ggv has the same issue
Comment 2 Marco Pesenti Gritti 2005-03-12 08:11:33 EST
Ok the reason this fail is that it doesnt have a %!PS line at the top. In that
case evince/ggv test if it's really a ps file by passing it to gs and checking
the return value. Apparently gs is returning an error though... so this fails.
Need to find a proper solution for this...
Comment 3 Marco Pesenti Gritti 2005-03-12 10:09:14 EST
Reassigning to ghostscript:

gs /usr/share/ghostscript/7.07/examples/snowflak.ps

while

gsnd /usr/share/ghostscript/7.07/examples/snowflak.ps

fails.

Or is there a legitimate reason for this behavior?
Comment 4 Michal Jaegermann 2005-03-12 13:26:41 EST
> Ok the reason this fail is that it doesnt have a %!PS line at the top.

The file indeed starts with "%!<LF>".  This is not so frequent
nowadays but I have seen many PostScript files which open that way.
I do not have appriopriate documents handy, nor I pretend to be
a "PostScript wizzard", but I _think_ that this '!%' is good enough
according to PostScript standards.  You need "PS-Adobe-<something>"
when you claim a conformance to some specific PostScript level.
A document may be "non-conforming", which does not mean "incorrect",
and then, IIRC, it _has to_ start with "%!" and nothing else.
So even if a document is "conforming" then "%!PS-Adobe-..." is
not obligatory.

At least 'file', hence /usr/share/misc/magic, does not have any
doubts that in 'snowflak.ps' we are looking at a PostScript file
and ghostscript is willing, correctly, to accept that too.
Comment 5 Marco Pesenti Gritti 2005-03-12 20:06:38 EST
>A document may be "non-conforming", which does not mean "incorrect",
>and then, IIRC, it _has to_ start with "%!" and nothing else.
>So even if a document is "conforming" then "%!PS-Adobe-..." is
>not obligatory.

Sure... and both evince and ggv handle that case. But they also try to
pass the poscript file to ghostscript with the NODISPLAY option to
verify it's actually a valid ps file.
Though for some reasons ghostscript fails to parse that file if
launched with NODISPLAY, while it works normally.

gsnd /usr/share/ghostscript/7.07/examples/snowflak.ps

Error: /undefinedresult in --div--
Operand stack:
   boxsize   72.0   0.0
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--  
--nostringval--   --nostringval--   false   1   %stopped_push   1   3
  %oparray_pop   1   3   %oparray_pop   1   3 %oparray_pop   1   3  
%oparray_pop   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1112/1686(ro)(G)--   --dict:0/20(G)--   --dict:81/200(L)--
Current allocation mode is local
Current file position is 1817
GPL Ghostscript 8.15: Unrecoverable error, exit code 1

While this works perfectly:

gs /usr/share/ghostscript/7.07/examples/snowflak.ps

I'm not a ghostscript expert really and I could be wrong... but that
seem like a ghostscript bug.
Comment 6 Michal Jaegermann 2005-03-13 00:02:40 EST
Aha, NODISPLAY is really an explanation!  My bet is that with
that option 'pathbox' operator in snowflak.ps gives small enough
values for 'pagewidth' and/or 'pageheight' to end up below 'minsize'.
Therefore 'inwidth' or 'inheight' are set to zero and you are trying
to do a division by zero when calculating 'boxsize'.

If you will change in snowflak.ps these two definitions as follows:

/inwidth pagewidth minsize lt
     {1}{pagewidth minsize div} ifelse def
/inheight pageheight minsize lt
     {1}{ pageheight minsize div} ifelse def

then a resulting file is displayable by 'evince'.  No problems
with "%!" marker.

The above does not look to me like a ghostcript problem at all.
If this should be classified as a bug in 'snowflak.ps' or 'evince'
I am not that sure.  For one reason or another 'gv' does not have
a problem with that and what 'evince' eventually "paints" looks
remarkably similar to a 'gv' display.
Comment 7 Marco Pesenti Gritti 2005-03-13 04:38:01 EST
Ok, that make sense. Reassigning back to epiphany. I need to look at
gv code to see how it handles this case.
Comment 8 Marco Pesenti Gritti 2005-05-31 06:34:19 EDT
I reported this upstream. Will try to get it fixed...

Note You need to log in before you can comment on or make changes to this bug.