Skip to content

Commit

Permalink
tests/test_pixmap.py: added test that calls fz_write_pixmap_as_jpeg().
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-smith-artifex-com committed Jan 6, 2024
1 parent 9d5f30d commit 1a9360d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_pixmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,9 @@ def test_page_idx_int():
assert doc[0]
assert doc[(0,0)]

def test_fz_write_pixmap_as_jpeg():
width, height = 13, 37
image = fitz.Pixmap(fitz.csGRAY, width, height, b"\x00" * (width * height), False)

with fitz.Document(stream=image.tobytes(output="jpeg"), filetype="jpeg") as doc:
test_pdf_bytes = doc.convert_to_pdf()

0 comments on commit 1a9360d

Please sign in to comment.