-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Read bounding box information from the trailer of EPS files if specified #7382
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
radarhere
reviewed
Sep 9, 2023
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 <3112309+radarhere@users.noreply.github.com>
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
radarhere
reviewed
Sep 23, 2023
radarhere
approved these changes
Oct 1, 2023
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.