mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-08-08 11:57:36 +00:00
3379535ca9
Upgrade to release 10.11.0:
- Extended PDF outline (bookmark) support to cover more of the spec
- Fixed 1-bit /Indexed images losing their palette when extracted.
{meth}pikepdf.PdfImage.as_pil_image and
{meth}pikepdf.PdfImage.extract_to previously ignored the palette
of a 1-bit indexed image over a /DeviceCMYK base (returning a
bilevel grayscale image) and of a single-colour palette (hival 0).
Both now decode correctly, matching the existing behavior for
2/4/8-bit indexed images.
- A 1-bit /Indexed image whose base colour space is unsupported (for
example /DeviceN or /Separation) now raises NotImplementedError
instead of silently returning an unpalettized image, matching the
2/4/8-bit path.
- Image extraction now verifies that the image stream holds enough\
data for the declared /Width and /Height before allocating, raising
{exc}~pikepdf.exceptions.ImageDecompressionError when it does not.
This closes the remaining decompression-bomb gaps left by the
{attr}pikepdf.PdfImage.MAX_IMAGE_PIXELS limit added in v10.10.0:
that limit bounds the declared size, but said nothing about whether
the declared size was consistent with the data present, so a 4-bit
image declaring 12000x12000 -- well under the default 500M pixel
budget -- still allocated ~300 MB from a single byte of stream
data, and setting the limit to None restored the unbounded case
entirely. The 2-bit and 4-bit unpack path and the 1-bit path
(where Pillow allocates a byte per pixel before it notices the
data is short) are both covered; 8-bit and 16-bit images already
failed cleanly. The check applies regardless of MAX_IMAGE_PIXELS.
- The 2-bit and 4-bit unpack buffer is no longer over-allocated by
a factor of the packing ratio, reducing peak memory for those
images by 4x and 2x respectively.
- Extracting a 1-, 2-, or 4-bit image whose stream is shorter than
its declared dimensions require now raises
- {exc}~pikepdf.exceptions.ImageDecompressionError rather than
returning a partially decoded image with a black tail. This
matches what 8-bit and 16-bit images have always done for the
same defect.
- An image with a non-positive /Width or /Height raises
{exc}~pikepdf.exceptions.InvalidPdfImageError instead of failing
further down with an obscure error from Pillow.
This work was sponsored by GOVCERT.LU.
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
36 lines
1010 B
BlitzBasic
36 lines
1010 B
BlitzBasic
SUMMARY = "Read, write, repair, and transform PDFs in Python, powered by qpdf"
|
|
DESCRIPTION = "A Python library for reading and writing PDF, powered by QPDF"
|
|
HOMEPAGE = "https://github.com/pikepdf/pikepdf"
|
|
LICENSE = "MPL-2.0"
|
|
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9741c346eef56131163e13b9db1241b3"
|
|
|
|
SRC_URI[sha256sum] = "4bebc59ac74411064e7c97a4036174023e22ccbecd22b78750ab76551eb38988"
|
|
|
|
SRC_URI += "file://0001-pyproject.toml-Do-not-strip.patch"
|
|
|
|
inherit pypi python_setuptools_build_meta
|
|
|
|
# pikepdf uses the C++20 language but no C++20 named modules. CMake's module
|
|
# dependency scanning (clang-scan-deps) does not work in the cross environment,
|
|
# so turn it off.
|
|
export CMAKE_ARGS = "-DCMAKE_CXX_SCAN_FOR_MODULES=OFF"
|
|
|
|
PYPI_PACKAGE = "pikepdf"
|
|
|
|
CVE_PRODUCT = "pikepdf"
|
|
|
|
DEPENDS += " \
|
|
python3-pybind11-native \
|
|
python3-nanobind-native \
|
|
python3-scikit-build-core-native \
|
|
ninja-native \
|
|
qpdf \
|
|
"
|
|
|
|
RDEPENDS:${PN} += " \
|
|
python3-pillow \
|
|
python3-lxml \
|
|
"
|
|
|
|
BBCLASSEXTEND = "native nativesdk"
|