Summary: | Attached PDF file is rendered with 0x0 page size | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Till Kamppeter <till.kamppeter> |
Component: | PDF Interpreter | Assignee: | Alex Cherepanov <alex> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | chris.liddell, roucaries.bastien+gs |
Priority: | P4 | ||
Version: | 9.05 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: | b1.pdf |
Description
Till Kamppeter
2012-07-22 19:09:54 UTC
What else Ghostscript can do? The sample file tries to set rather small page size. /MediaBox [0 0 0.00108919 0.00181758] (In reply to comment #1) > What else Ghostscript can do? > > The sample file tries to set rather small page size. > /MediaBox [0 0 0.00108919 0.00181758] - first solve the crash in X by rounding up instead of having zero size windows. - second at your whish: * do like plopper in this case * error out with an meaningful error Bastien (In reply to comment #2) > > - first solve the crash in X by rounding up instead of having zero size > windows. There is no "crash" in X - there is an exit with an error condition, and a meaningful error message from the library which triggered the error. > - second at your whish: > * do like plopper in this case Poppler is not following the spec, and that strikes me as bad. > * error out with an meaningful error There is no error, from our point-of-view. For both PDF and Postscript 0 x 0 are valid (if pointless) page dimensions, thus we accept the size request. 0 x 0 is not a valid window size for X, thus the X library throws an error, with a meaningful error message. The X error does cause an "exit" to occur (in the X library, which is poor form, IMHO), so there's not much "recovery" we can do, from that stage. (In reply to comment #3) > (In reply to comment #2) > > > > - first solve the crash in X by rounding up instead of having zero size > > windows. > > There is no "crash" in X - there is an exit with an error condition, and a > meaningful error message from the library which triggered the error. > > > - second at your whish: > > * do like plopper in this case > > Poppler is not following the spec, and that strikes me as bad. > > > * error out with an meaningful error > > There is no error, from our point-of-view. For both PDF and Postscript 0 x 0 > are valid (if pointless) page dimensions, thus we accept the size request. > > 0 x 0 is not a valid window size for X, thus the X library throws an error, > with a meaningful error message. The X error does cause an "exit" to occur (in > the X library, which is poor form, IMHO), so there's not much "recovery" we can > do, from that stage. Ok the poor form could be solved with XSetErrorHandler/XSetIOErrorHandler. About poppler, it crash the first time I submit this file. Thus they solve half part of the problem. Will resubmit bug with non conformant behavior. Could I copy your comment to the poppler bug report ? Bastien (In reply to comment #4) > > Ok the poor form could be solved with XSetErrorHandler/XSetIOErrorHandler. True, but what would we gain? At the moment you get a fairly clear error message from the source of the error. All we could really do would be print some other message, and exit somewhere else...... > > About poppler, it crash the first time I submit this file. Thus they solve half > part of the problem. Will resubmit bug with non conformant behavior. > > Could I copy your comment to the poppler bug report ? You can if you like. I suspect their (quite reasonable) position will be: it's a dumb thing to do, we're not going to lose sleep over it. Chris I've added code to check the requested pagesize and, if it's zero (or less!) in either dimension, inform the user, and return a rangecheck error, before we pass the request to X. http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=f661e522 |