Skip to content

Commit

Permalink
BUG: Errors in transfer_rotation_to_content() (#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
pubpub-zz authored Sep 22, 2022
1 parent 141a765 commit 7803a72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PyPDF2/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,9 @@ def transfer_rotation_to_content(self) -> None:
self.add_transformation(trsf, False)
for b in ["/MediaBox", "/CropBox", "/BleedBox", "/TrimBox", "/ArtBox"]:
if b in self:
pt1 = trsf.apply_on(cast(RectangleObject, self[b]).lower_left)
pt2 = trsf.apply_on(cast(RectangleObject, self[b]).upper_right)
rr = RectangleObject(self[b]) # type: ignore
pt1 = trsf.apply_on(rr.lower_left)
pt2 = trsf.apply_on(rr.upper_right)
self[NameObject(b)] = RectangleObject(
(
min(pt1[0], pt2[0]),
Expand Down

0 comments on commit 7803a72

Please sign in to comment.