4 Commits
Author SHA1 Message Date
Leon Anavi ae0db48cac python3-pikepdf: Upgrade 10.11.0 -> 10.13.0.post1
Upgrade to release 10.13.0.post1:

- Behavior change: pikepdf.DataDecodingError now derives from
  pikepdf.PdfError. A stream that will not decode is a defect in
  the document, and the same call that raises it -
  Object.read_bytes() - already raised PdfError for other kinds of
  damage, so except PdfError was a handler that looked correct,
  passed on healthy files, and let a traceback escape on damaged
  ones. Code catching DataDecodingError by name is unaffected. Code
  that orders except PdfError before except DataDecodingError will
  now take the first branch; if the distinction matters, reverse
  the order.
- Behavior change: pikepdf.PdfParsingError now derives from
  pikepdf.PdfError, for the same reason.
- pikepdf.PasswordError remains a sibling of PdfError, not a
  subclass. A wrong password does not mean the document is
  defective, and handlers that report the two separately depend on
  except PdfError not catching it.
- pikepdf.NotExtractableError is now exported. It was already the
  base class of the exported HifiPrintImageNotTranscodableError but
  could not be caught by name.
- Fixed the exceptions documentation, which referenced a nonexistent
  FormCopyWarning (the class is PageCopyWarning) and omitted
  ReferenceCycleError, PageCopyWarning and NotExtractableError.
- XMP assigns a type to every standard property, and software that
  reads XMP discards a property whose type is wrong - Ghostscript
  strips these silently, and PDF/A validators reject them. pikepdf
  used to choose the RDF container from the Python type of the
  value it was handed, so meta['dc:subject'] = ['a', 'b'] wrote an
  rdf:Seq where the specification requires an rdf:Bag, and
  meta['dc:creator'] = 'Author' wrote a bare string where an
  rdf:Seq belongs. pikepdf now knows the type of the properties in
  the standard schemas and converts values to it.

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>
2026-09-22 11:36:20 -07:00
Ross Burton 3809d75326 meta-python: remove redundant PYPI_PACKAGE assignments
Remove assignments to PYPI_PACKAGE where the value is the default value,
that is the recipe name with any python3- prefix removed.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-09-04 17:10:37 -07:00
Leon Anavi fe79e6e5c2 python3-pikepdf: Enable tests
Inherit ptest-python-pytest and include tests for PikePDF. Extend
runtime dependencies and add new for the tests.

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>
2026-08-06 23:32:44 -07:00
Leon Anavi 3379535ca9 python3-pikepdf: Upgrade 10.10.0 -> 10.11.0
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>
2026-08-05 23:37:22 -07:00