Fix ValueError when bmp images with 1 bit channels are decoded (fixes #773) (#784)

* Update utils.py

bitspercomponent =1 is defined and stores as a .btm worked when I tested it

* Update utils.py

() replaced with []

* Update CHANGELOG.md

added changes for pull request

* Update for flake

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Pieter Marsman <pietermarsman@gmail.com>
pull/802/head
pettzilla1 2022-08-08 21:35:53 +01:00 committed by GitHub
parent 7b7889ff6a
commit f79ad56f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- 'ValueError': when bmp images with 1 bit channel are decoded ([#773](https://github.com/pdfminer/pdfminer.six/issues/773))
- `ValueError` when trying to decrypt empty metadata values ([#766](https://github.com/pdfminer/pdfminer.six/issues/766))
- Sphinx errors during building of documentation ([#760](https://github.com/pdfminer/pdfminer.six/pull/760))
- `TypeError` when getting default width of font ([#720](https://github.com/pdfminer/pdfminer.six/issues/720))

View File

@ -132,7 +132,7 @@ def apply_png_predictor(
Documentation: http://www.libpng.org/pub/png/spec/1.2/PNG-Filters.html
"""
if bitspercomponent != 8:
if bitspercomponent not in [8, 1]:
msg = "Unsupported `bitspercomponent': %d" % bitspercomponent
raise ValueError(msg)