Skip to content

Commit ca1e7ef

Browse files
CI failures fix
1 parent b1bee72 commit ca1e7ef

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

pypdf/_cmap.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,11 @@ def build_font_width_map(
460460
# will consider width of char as avg(width)
461461
m = 0
462462
cpt = 0
463-
for xx in w:
464-
xx_value = xx.get_object()
465-
if xx_value > 0:
466-
m += xx_value
467-
cpt += 1
463+
for xx in w:
464+
xx_value = xx.get_object()
465+
if xx_value > 0:
466+
m += xx_value
467+
cpt += 1
468468
font_width_map["default"] = m / max(1, cpt)
469469
st = cast(int, ft["/FirstChar"])
470470
en = cast(int, ft["/LastChar"])

pypdf/_page.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,11 @@ def _get_inline_images(self) -> dict[str, ImageFile]:
740740
if k in {"/Length", "/L"}: # no length is expected
741741
continue
742742
if isinstance(v, list):
743-
value_for_init = ArrayObject(
744-
[self._translate_value_inline_image(k, x) for x in v]
743+
value_for_init = cast(
744+
PdfObject,
745+
ArrayObject(
746+
[self._translate_value_inline_image(k, x) for x in v]
747+
),
745748
)
746749
else:
747750
value_for_init = self._translate_value_inline_image(k, v)

pypdf/_text_extraction/_layout_mode/_font.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ def __post_init__(self) -> None:
6464
for d_font_idx, d_font in enumerate(
6565
self.font_dictionary["/DescendantFonts"]
6666
):
67-
d_font_object = d_font.get_object()
67+
if isinstance(d_font, IndirectObject):
68+
d_font_object = d_font.get_object()
69+
else:
70+
d_font_object = d_font
6871
assert not isinstance(d_font_object, IndirectObject), d_font_object
6972
self.font_dictionary["/DescendantFonts"][d_font_idx] = d_font_object
7073
ord_map = {

0 commit comments

Comments
 (0)