diff --git a/pdfminer/pdfinterp.py b/pdfminer/pdfinterp.py index c1a85973..7d7da4f9 100644 --- a/pdfminer/pdfinterp.py +++ b/pdfminer/pdfinterp.py @@ -938,7 +938,7 @@ def do_ID(self) -> None: def do_EI(self, obj: PDFStackT) -> None: """End inline image object""" - if isinstance(obj, PDFStream) and "W" in obj and "H" in obj: + if isinstance(obj, PDFStream) and hasattr(obj, 'W') and hasattr(obj, 'H'): iobjid = str(id(obj)) self.device.begin_figure(iobjid, (0, 0, 1, 1), MATRIX_IDENTITY) self.device.render_image(iobjid, obj)