1
0
Fork 0

Merging upstream version 0.7.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-08 07:48:59 +01:00
parent e69e30697e
commit e337ad61c4
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
5 changed files with 47 additions and 5 deletions

View file

@ -8,9 +8,14 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.8'] python-version: ['3.11']
include:
- os: ubuntu-latest
python-version: '3.7'
- os: ubuntu-latest
python-version: 'pypy-3.8'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
/docs/_build /docs/_build
/tests/results /tests/results
/dist/
__pycache__ __pycache__
.coverage .coverage

View file

@ -2,6 +2,41 @@ Changelog
========= =========
Version 0.7.0
-------------
Released on 2023-07-03.
Dependencies:
* Python 3.11 is supported and tested
Bug fixes:
* Fix size of fields for xref
Backers and sponsors:
* Castedo Ellerman
* Spacinov
* Kobalt
* Grip Angebotssoftware
* Crisp BV
* Manuel Barkhau
* SimonSoft
* Menutech
* KontextWork
* NCC Group
* René Fritz
* TrainingSparkle
* Healthchecks.io
* Moritz Mahringer
* Yanal-Yvez Fargialla
* Synapsium
* Piotr Horzycki
* Hammerbacher
Version 0.6.0 Version 0.6.0
------------- -------------

View file

@ -9,7 +9,7 @@ from codecs import BOM_UTF16_BE
from hashlib import md5 from hashlib import md5
from math import ceil, log from math import ceil, log
VERSION = __version__ = '0.6.0' VERSION = __version__ = '0.7.0'
def _to_bytes(item): def _to_bytes(item):
@ -549,11 +549,11 @@ class PDF:
object_.generation)) object_.generation))
xref.append((1, self.current_position, 0)) xref.append((1, self.current_position, 0))
field2_size = ceil(log(self.current_position, 8)) field2_size = ceil(log(self.current_position + 1, 256))
max_generation = max( max_generation = max(
object_.generation for object_ in self.objects) object_.generation for object_ in self.objects)
field3_size = ceil(log( field3_size = ceil(log(
max(max_generation, len(compressed_objects)), 8)) max(max_generation, len(compressed_objects)) + 1, 256))
xref_lengths = (1, field2_size, field3_size) xref_lengths = (1, field2_size, field3_size)
xref_stream = b''.join( xref_stream = b''.join(
value.to_bytes(length, 'big') value.to_bytes(length, 'big')

View file

@ -23,6 +23,7 @@ classifiers = [
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy', 'Programming Language :: Python :: Implementation :: PyPy',
] ]