MatthiasValvekens / pyHanko

pyHanko: sign and stamp PDF files
MIT License
483 stars 71 forks source link

Change ByteRange placeholder to allow bigger input #337

Closed MatthiasValvekens closed 10 months ago

MatthiasValvekens commented 10 months ago

Description of the changes

This changes the way the ByteRange array placeholder is calculated to deal with files larger than 100MB. The root cause was a format string (going back to the very first prototype) that aligned everything to 8 digits. We now always allocate 60 bytes of whitespace and put the offsets in there. This fixes #336.

Checklist

Please go over this checklist to increase the chances of your PR being worked on in a timely manner. Deviations are allowed with proper justification (see previous section).

For bug fixes (delete if not applicable)

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (99ab33b) 98.76% compared to head (0a66252) 98.80%. Report is 19 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #337 +/- ## ========================================== + Coverage 98.76% 98.80% +0.03% ========================================== Files 104 104 Lines 14712 14773 +61 ========================================== + Hits 14530 14596 +66 + Misses 182 177 -5 ``` | [Flag](https://app.codecov.io/gh/MatthiasValvekens/pyHanko/pull/337/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/MatthiasValvekens/pyHanko/pull/337/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens) | `98.80% <100.00%> (+0.03%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/MatthiasValvekens/pyHanko/pull/337?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens) | Coverage Δ | | |---|---|---| | [pyhanko/sign/signers/pdf\_byterange.py](https://app.codecov.io/gh/MatthiasValvekens/pyHanko/pull/337?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens#diff-cHloYW5rby9zaWduL3NpZ25lcnMvcGRmX2J5dGVyYW5nZS5weQ==) | `100.00% <100.00%> (ø)` | | ... and [7 files with indirect coverage changes](https://app.codecov.io/gh/MatthiasValvekens/pyHanko/pull/337/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthias+Valvekens)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.