Skip to content

Commit

Permalink
expand variables
Browse files Browse the repository at this point in the history
  • Loading branch information
pubpub-zz committed Feb 20, 2024
1 parent cc00add commit ccbf67a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pypdf/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,15 +440,15 @@ def _get_ids_image(
else:
call_stack.append(_i)
if self.inline_images_keys is None:
st = self._get_contents_as_bytes() or b""
content = self._get_contents_as_bytes() or b""
nb_inlines = 0
for ma in re.finditer(
for matching in re.finditer(
WHITESPACES_AS_REGEXP + b"BI" + WHITESPACES_AS_REGEXP,
st,
content,
):
st1 = st[: ma.start()]
if len(re.findall(b"[^\\\\]\\(", st1)) == len(
re.findall(b"[^\\\\]\\)", st1)
start_of_string = content[: matching.start()]
if len(re.findall(b"[^\\\\]\\(", start_of_string)) == len(
re.findall(b"[^\\\\]\\)", start_of_string)
):
nb_inlines += 1
self.inline_images_keys = [f"~{x}~" for x in range(nb_inlines)]
Expand Down

0 comments on commit ccbf67a

Please sign in to comment.