Skip to content

Commit 0eb3d65

Browse files
authored
Merge pull request #7122 from tk0miya/7120_scaling_svg
Fix #7120: html: crashed when on scaling SVG images which have float dimentions
2 parents c86e17d + 6cdc092 commit 0eb3d65

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Features added
1616
Bugs fixed
1717
----------
1818

19+
* #7120: html: crashed when on scaling SVG images which have float dimentions
20+
1921
Testing
2022
--------
2123

sphinx/util/images.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def get_image_size(filename: str) -> Tuple[int, int]:
4545
size = imagesize.get(filename)
4646
if size[0] == -1:
4747
size = None
48+
elif isinstance(size[0], float) or isinstance(size[1], float):
49+
size = (int(size[0]), int(size[1]))
4850

4951
if size is None and Image: # fallback to Pillow
5052
im = Image.open(filename)

0 commit comments

Comments
 (0)