Summary: | gs misparses %%ViewingOrientation and other comments | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | William Bader <williambader> |
Component: | PS Interpreter | Assignee: | Alex Cherepanov <alex> |
Status: | NOTIFIED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 8.62 | ||
Hardware: | All | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: |
sample.ps
dsc.pat improved patch |
Description
William Bader
2008-04-14 19:45:23 UTC
Created attachment 3931 [details]
sample.ps
Sample page that ps2pdf sets the wrong orientation because it looks at comments
inside an embedded eps.
Created attachment 3932 [details]
dsc.pat
Patch to zdscpars.c to ignore comments between begin and end pairs in the bad
list. This fixes my problem, but there is probably a better way to do it.
Unpaired begins will cause problems.
Assigning to Alex to review (and hopefully commit) the patch. Created attachment 3952 [details]
improved patch
This patch keeps the nesting counter in the dsc_data_t structure instead of the
static variable.
The improved patch is committed as a rev. 8653. Regression testing shows no differences. The DSC parser does pay attention to %%BeginData and %%BeginDocument, and skips over the embedded files. Ghostscript doesn't make use of this information, but could be made to ignore DSC comments from embedded files. The CDSC structure contains the following semi-private variables which could be used by Ghostscript to determine if the DSC parser is currently skipping DSC comments. int skip_document; /* recursion level of %%BeginDocument: */ int skip_bytes; /* #bytes to ignore from BeginData: */ /* or DOSEPS preview section */ Using these would probably result in a more robust fix. The comment in zdscpars.c above the declaration of BadCmdlist says "If we send the data block type comments, Russell's parser will want to skip the specified block of data. This is not appropriate for our situation." Will passing comments with data length parameters cause problems? |