-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read bounding box information from the trailer of EPS files if specified #7382
Conversation
I'm guessing you created the test image by opening up one of our existing test images in a text editor and modifying it manually? |
Yes, I simply modified |
Co-authored-by: Andrew Murray <[email protected]>
Not necessarily, no. Real images are certainly ideal, but created ones are also accepted, as it's not always possible/practical to find an image that triggers a certain scenario. |
Last trailer comment has priority
The bounding box for EPS images is currently only parsed from the file header. However, the DSC specification also allows it to be specified in the trailer (see Section 4.6 of the specification). According to the specification, this must be indicated in the header using
%%BoundingBox: (atend)
. The real bounding box information is then specified at the end of the file following the%%Trailer
comment. For an example, seeTests/images/zero_bb_trailer.eps
.Currently, the
EpsImagePlugin
tries to parse the bounding box only from the header, which fails if the value is(atend)
. This PR fixes the error and implements boundary box parsing from the trailer.