Bug 692832 - Missing text reading PS file
Summary: Missing text reading PS file
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: 9.04
Hardware: PC All
: P1 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-01 20:53 UTC by Marcos H. Woehrmann
Modified: 2012-04-12 16:42 UTC (History)
3 users (show)

See Also:
Customer: 531
Word Size: ---


Attachments
Simple patch (1.28 KB, patch)
2012-02-11 07:43 UTC, Alex Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2012-02-01 20:53:48 UTC
The customer reports and I've verified that Ghostsript 9.04 and master as well as earlier versions render the attached PostScript file with the names of the states (e.g. Missouri) missing in the "Earthquake History of the Southeastern U.S." map in the lower left hand corner (see the attached screenshot.png).

The command line I'm using for testing:

  bin/gs -sDEVICE=tiff24nc -o test.tif -r300 ./EQ.PS

Apple Preview and Adobe Acrobat Distiller both include the state names.
Comment 4 Alex Cherepanov 2012-02-02 06:46:05 UTC
Type 3 font in the file has incorrect setcachedevice
  /C81 {1741 0 1237340 1237340 1638.33 1520.33 setcachedevice

This bounding box excludes most of the glyph.
Changing 1237340 into 0 makes the file render correctly.

We need to decide how to detect an invalid glyph bounding box.
Comment 5 Chris Liddell (chrisl) 2012-02-02 15:20:31 UTC
Could we install the bbox device "before" the cache device, run the BulidChar, and then compare the accumulated bounding box with the parameters from the setcachedevice? Then, if the former is (significantly) larger than the latter, rerun the BuildChar either uncached, or with the cache device using the accumulated bbox?

I know it means special things for Type 3 fonts, but it's hard to see a reliable alternative.
Comment 6 Ken Sharp 2012-02-02 15:36:24 UTC
(In reply to comment #5)
> Could we install the bbox device "before" the cache device, run the BulidChar,
> and then compare the accumulated bounding box with the parameters from the
> setcachedevice? Then, if the former is (significantly) larger than the latter,
> rerun the BuildChar either uncached, or with the cache device using the
> accumulated bbox?
> 
> I know it means special things for Type 3 fonts, but it's hard to see a
> reliable alternative.

Sounds like a performance penalty for type 3 fonts to me.....
Comment 7 Chris Liddell (chrisl) 2012-02-02 16:13:54 UTC
Depending on how CPSI behaves:

As discussed on IRC, a simpler/safer/quicker solution for this *class* of problem file would be a fairly simple sanity check on the parameters in set_cache_device() and if the bounding box numbers are nonsense, render uncached.
Comment 8 Ray Johnston 2012-02-02 17:26:49 UTC
The bbox device wouldn't add very much performance penalty, and Type 3 fonts
aren't very common, so IMHO, the performance hit wouldn't be a big deal.

Now that I said that I expect one of our high priority customers to send
us a file they complain is too slow, and we will find it is due to Type 3 ;-)
Comment 10 Henry Stiles 2012-02-03 18:00:49 UTC
Ray can you tell us the CPSI results for this file.
Comment 11 Ray Johnston 2012-02-03 18:09:12 UTC
Created attachment 8332 [details]
CPSI_render_EQ-cut.pdf

Results from CPSI. I  hope it has all the info you need. There were no messages
in the RIP log
Comment 12 Marcos H. Woehrmann 2012-02-08 06:37:06 UTC
Please update the bug status so I can let the customer know what progress we are making.
Comment 13 Alex Cherepanov 2012-02-11 07:43:36 UTC
Created attachment 8347 [details]
Simple patch

Reject setcachedevice calls with large arguments.
This is the easiest approach.
It solves the problem and causes no significant differences on the cluster.
A few sporadic differences are, probably, caused by indeterminism.
Comment 14 Alex Cherepanov 2012-02-25 00:02:45 UTC
The patch has been committed as:
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=77a8045048a4aaa727f700187816170d7fbd072c