Skip to content

Commit

Permalink
release v2.1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisschellekens committed Dec 17, 2023
1 parent 4365c9e commit bf877fc
Show file tree
Hide file tree
Showing 841 changed files with 1,802 additions and 1,654 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patreon: borbpdf
Empty file modified .github/ISSUE_TEMPLATE/bug_report.md
100755 → 100644
Empty file.
Empty file modified .github/ISSUE_TEMPLATE/feature_request.md
100755 → 100644
Empty file.
Empty file modified .github/workflows/python-publish.yml
100755 → 100644
Empty file.
26 changes: 26 additions & 0 deletions .github/workflows/python-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Smoke Test(s) Against Multiple Python Versions

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest tests/pdf/canvas/layout/test_new_layout_methods_without_visual_compare.py
4 changes: 2 additions & 2 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test Against Multiple Python Versions
name: All Test(s) Against Multiple Python Versions

on: [push]
on: []

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,6 @@ dmypy.json
.prof

# secrets
tests/secrets.py
tests/borb_secrets.py

# End of https://www.toptal.com/developers/gitignore/api/python,pycharm
26 changes: 13 additions & 13 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://borbpdf.com. For AGPL licensing, see below.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://borbpdf.com. For AGPL licensing, see below.

AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Corpus Coverage : 100.0%](https://img.shields.io/badge/corpus%20coverage-100.0%25-green)]()
[![Text Extraction : 93.1%](https://img.shields.io/badge/text%20extraction-93.1%25-green)]()
[![Public Method Documentation : 100%](https://img.shields.io/badge/public%20method%20documentation-100%25-green)]()
[![Number of Tests : 735](https://img.shields.io/badge/number%20of%20tests-735-green)]()
[![Number of Tests : 744](https://img.shields.io/badge/number%20of%20tests-744-green)]()
[![Python : 3.8 | 3.9 | 3.10 ](https://img.shields.io/badge/python-3.8%20&#124;%203.9%20&#124;%203.10-green)]()

[![Downloads](https://pepy.tech/badge/borb)](https://pepy.tech/project/borb)
Expand Down
9 changes: 9 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Reporting Security Issues

The `borb` team and community take security bugs in ``borb seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.

To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/jorisschellekens/borb/security/advisories/new) tab.

The `borb` team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.

Report security bugs in third-party modules to the person or team maintaining the module.
12 changes: 7 additions & 5 deletions borb/io/filter/lzw_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class bitarray:
#

def __init__(self, input: bytes):
self._src: bytes = input
self._pos: int = -1
self._buffer: typing.List[int] = []
self._default_to_return: int = 256
self._pos: int = -1
self._src: bytes = input

#
# PRIVATE
Expand Down Expand Up @@ -73,7 +73,7 @@ def __init__(self):
# PRIVATE
#

def _add_to_lookup_table(self, prev_bytes: bytearray, new_bytes: bytes):
def _add_to_lookup_table(self, new_bytes: bytes, prev_bytes: bytearray):
self._lookup_table[self._table_index] = prev_bytes + new_bytes
self._table_index += 1
if self._table_index == 511:
Expand Down Expand Up @@ -126,13 +126,15 @@ def decode(self, input: bytes):
if code < self._table_index:
x = self._lookup_table[code]
bytes_out += x
self._add_to_lookup_table(self._lookup_table[prev_code], x[0:1])
self._add_to_lookup_table(
new_bytes=x[0:1], prev_bytes=self._lookup_table[prev_code]
)
prev_code = code
else:
x = self._lookup_table[prev_code]
x = x + x[0:1]
bytes_out += x
self._add_to_lookup_table(x, bytearray())
self._add_to_lookup_table(new_bytes=bytearray(), prev_bytes=x)
prev_code = code

# return bytes
Expand Down
5 changes: 5 additions & 0 deletions borb/io/filter/stream_decode_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def decode_stream(s: Stream) -> Stream:
assert ("Bytes" in s), "decode_stream only works on Stream objects with a `Bytes` key."
# fmt: on

# IF stream already has /DecodedBytes
# THEN return stream
if "DecodedBytes" in s:
return s

# determine filter(s) to apply
filters: typing.List[str] = []
if "Filter" in s:
Expand Down
12 changes: 6 additions & 6 deletions borb/io/read/any_object_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
import io
import typing

# fmt: off
from borb.io.read.font.font_dictionary_transformer import FontDictionaryTransformer
from borb.io.read.function.function_dictionary_transformer import (
FunctionDictionaryTransformer,
)
from borb.io.read.function.function_dictionary_transformer import FunctionDictionaryTransformer
from borb.io.read.image.ccitt_fax_image_transformer import CCITTFaxImageTransformer
from borb.io.read.image.compressed_jpeg_image_transformer import (
CompressedJPEGImageTransformer,
)
from borb.io.read.image.compressed_jpeg_image_transformer import CompressedJPEGImageTransformer
from borb.io.read.image.grayscale_image_transformer import GrayscaleImageTransformer
from borb.io.read.image.jbig2_image_transformer import JBIG2ImageTransformer
from borb.io.read.image.jpeg_2000_image_transformer import JPEG2000ImageTransformer
Expand All @@ -36,6 +33,9 @@
from borb.pdf.canvas.event.event_listener import EventListener


# fmt: on


class AnyObjectTransformer(Transformer):
"""
This implementation of ReadBaseTransformer aggregates all other implementations
Expand Down
Loading

0 comments on commit bf877fc

Please sign in to comment.