-
Notifications
You must be signed in to change notification settings - Fork 10.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
Document: handle indirect objects in MediaBox
and CropBox
entries
#7873
Document: handle indirect objects in MediaBox
and CropBox
entries
#7873
Conversation
bca1768
to
ade0700
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be totally honest, I'm imagining a much simpler and more general solution here. (Since this issue may happen again in the future if support for other "array" parameters are added).
My thinking is something like master...Snuffleupagus:issue-7872 instead, and a reduced test-case should be is easy to create here.
Should I submit a PR with that change, and a test-case included?
I think that's a nice solution as well. Good point! The only thing I think makes sense is to create the That being said, I do like your solution of not including the |
That's a fair point, but I've got one small reservation: This would require us to always compute the intersection, since then |
Yes, I think that should be possible. I'll update the PR soon. |
… fetch (and dereference) Arrays, and use that for the `MediaBox`/`CropBox` getters (issue 7872)
ade0700
to
e99e225
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
r=me, with nits, assuming that the tests pass of course!
Edit: Obviously I cannot review my own patch, but yours look good :-)
return shadow(this, 'view', cropBox); | ||
|
||
var intersection = Util.intersect(cropBox, mediaBox); | ||
return shadow(this, 'view', !intersection ? mediaBox : intersection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: It would probably suffice to just check intersection || mediaBox
here, instead of the ternary condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the new commit.
return shadow(this, 'view', mediaBox); | ||
} | ||
return shadow(this, 'view', cropBox); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'm not sure if we need this newline for readability, let's make the diff smaller instead :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the new commit.
This patch refactors the `CropBox` code to combine fetching and validation code in a getter, like we already did for the `MediaBox` property. Combined with variable name changes, this improves readability of the code and makes the `view` getter simpler as well.
e99e225
to
3800b5e
Compare
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/ee96f18edb328f3/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/ee96f18edb328f3/output.txt Total script time: 2.06 mins Published |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/970733f8e65554e/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/9c80ac6c851058d/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/970733f8e65554e/output.txt Total script time: 26.47 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/9c80ac6c851058d/output.txt Total script time: 26.55 mins
|
/botio makeref |
From: Bot.io (Linux)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/599d47f295aedb8/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/2bcf17ccfb2af69/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/2bcf17ccfb2af69/output.txt Total script time: 26.10 mins
|
Even though the message has not been posted, the Linux bot finished successfully. Merging with r=me for @Snuffleupagus' commit. Thanks! |
…ndirect Document: handle indirect objects in `MediaBox` and `CropBox` entries
Fixes #7872.