Skip to content

Commit

Permalink
Remove duplicated code that was unnecessarily reinitializing variables.
Browse files Browse the repository at this point in the history
pix = fitz.Pixmap(pix, width, height)

File ".../pymupdf/__init__.py", line 9829, in __init__
   spix, w, h, clip = args
ValueError: not enough values to unpack (expected 4, got 3)
  • Loading branch information
tenboshi authored Jan 21, 2025
1 parent bbae37e commit ccafb56
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9828,9 +9828,7 @@ def __init__(self, *args):
spix, w, h, clip = args
bbox = JM_irect_from_py(clip)

spix, w, h, clip = args
src_pix = spix.this if isinstance(spix, Pixmap) else spix
bbox = JM_irect_from_py(clip)
if not mupdf.fz_is_infinite_irect(bbox):
pm = mupdf.fz_scale_pixmap(src_pix, src_pix.x(), src_pix.y(), w, h, bbox)
else:
Expand Down

0 comments on commit ccafb56

Please sign in to comment.