Skip to content

1.17.6: insertImage: rect cannot be a list #622

Closed
@cbm755

Description

@cbm755

On upgrade to 1.17.6, I started getting:

         pg.insertImage(rec, filename=img)
       File "/usr/local/lib/python3.6/dist-packages/fitz/utils.py", line 290, in insertImage
         if r.isEmpty or r.isInfinite:
     AttributeError: 'list' object has no attribute 'isEmpty'

configuration

  • GNU/Linux, Ubuntu 18.04, Fedora 32, several machines
  • Python 3.6 and 3.8 (so far)
  • PyMuPDF 1.17.6 from pip (via wheel I suppose)
3.8.5 (default, Aug 12 2020, 00:00:00) 
[GCC 10.2.1 20200723 (Red Hat 10.2.1-1)] 
 linux 
 
PyMuPDF 1.17.6: Python bindings for the MuPDF 1.17.0 library.
Version date: 2020-08-26 14:54:32.
Built for Python 3.8 on linux (64-bit).

Minimal example:

doc = fitz.open()
pg = exam.newPage()
rec = [10, 10, 90, 80]
pg.insertImage(rec, filename="image.png")                 
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-8-7970f4ceb718> in <module>
----> 1 pg.insertImage(rec, filename="target_Q_latex_plom.png")

~/.local/lib/python3.8/site-packages/fitz/utils.py in insertImage(page, rect, filename, pixmap, stream, rotate, keep_proportion, overlay)
    288 
    289     r = rect
--> 290     if r.isEmpty or r.isInfinite:
    291         raise ValueError("rect must be finite and not empty")
    292 

AttributeError: 'list' object has no attribute 'isEmpty'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions