Summary: | bbox gives wrong values | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Jaime Villate <villate> |
Component: | Other Driver | Assignee: | Marcos H. Woehrmann <marcos.woehrmann> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: |
screenshot.png
screenshot.png screenshot.png screenshot.png Another test case for head (r8363). Please check. |
Description
Jaime Villate
2007-11-04 10:19:36 UTC
Ghostscript actually measures the bbox from the image. One thing that can affect the bbox is the fonts used. Just looking at the %%BoundingBox in the source file is not a good way to tell what the real bbox is. Even taking Comment #1 into account the bounding box is not correct. With gshead (r8363) I get a slightly different result: % bin/gs -sDEVICE=bbox 689548.ps %%BoundingBox: 55 99 267 161 %%HiResBoundingBox: 55.835998 99.499005 266.003992 160.492987 However, by adding "55 99 267 161 rectstroke" to the file before the showpage we can see the top and right of the bounding box is still incorrect (see screenshot.png, attached). Created attachment 3556 [details]
screenshot.png
Created attachment 3557 [details]
screenshot.png
Created attachment 3558 [details]
screenshot.png
Created attachment 3559 [details] screenshot.png Please ignore comment #2. I was confused as to how rectstroke works, it takes x,y,width,height, not x1,y1,x2,y2. The correct line to add is: 55 99 212 62 rectstroke Which produces a reasonable bounding (see screenshot.png, attached). Created attachment 3560 [details]
Another test case for head (r8363). Please check.
Marcos: does that mean that the bug has been fixed in a version after 8.61? To
which version should a upgrade to avoid the bug?
Since I cannot try the HEAD (r8363) version, I'm sending you a simpler test
case, which gives a bounding box
%%BoundingBox: 0 0 0 0
in gs 8.61, while it gave the correct value in gs 8.01:
%%BoundingBox: 199 498 321 560
Ray: I was not looking at the values in %%BoundingBox in the file but at the
vaues in the image, as shown by gv. Even without using any fonts, the problem
remains, as you can see in the attached file, which gives an empty bounding box
in ghostscript 8.61.
gshead (r8363) gives the correct results:
marcos@amd64:[49]% gshead -sDEVICE=bbox ./689548.ps
GPL Ghostscript SVN PRE-RELEASE 8.61 (2007-08-02)
Copyright (C) 2007 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
%%BoundingBox: 199 498 321 561
%%HiResBoundingBox: 199.997994 498.401985 320.003990 560.015983
>>showpage, press <return> to continue<<
|