From 3b2fedf55e192078681320caef08844be00cc2ab Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Thu, 11 Jan 2024 15:50:50 +0000 Subject: [PATCH] src/__init__.py: fixed test_delete_image(). To create mupdf.FzDefaultColorspaces with m_internal=null, need to do mupdf.FzDefaultColorspaces(None). [FzDefaultColorspaces() uses fz_new_default_colorspaces().] To create mupdf.FzImage with m_internal=null, need to do `FzImage()` [FzImage(0) will fail because ambiguous with single-arg constructors that takes a buffer or a string.] --- src/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/__init__.py b/src/__init__.py index 686bfd31c..4ed8ce6b0 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -7753,13 +7753,13 @@ def _insert_image(self, arg_pix, mupdf.FzColorspace(0), mupdf.FzColorspace(0), - mupdf.FzDefaultColorspaces(0), + mupdf.FzDefaultColorspaces(None), mupdf.FzColorParams(), 1, ) pm.alpha = 0 pm.colorspace = None - mask = mupdf.fz_new_image_from_pixmap(pm, mupdf.FzImage(0)) + mask = mupdf.fz_new_image_from_pixmap(pm, mupdf.FzImage()) image = mupdf.fz_new_image_from_pixmap(arg_pix, mask) #goto have_image() do_process_stream = 0 @@ -9418,7 +9418,7 @@ def __init__(self, *args): spix, cs, mupdf.FzColorspace(0), - mupdf.FzDefaultColorspaces(0), + mupdf.FzDefaultColorspaces(None), mupdf.FzColorParams(), 1 ) @@ -21652,6 +21652,7 @@ def _atexit(): Document.set_toc_item = utils.set_toc_item Document.subset_fonts = utils.subset_fonts Document.tobytes = Document.write +Document.xref_copy = utils.xref_copy IRect.get_area = utils.get_area