diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-09 22:22:27 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-09 22:22:27 +0900 |
| commit | 6cdc09272e17dea0c7c6bc77f0cdcc0867a9e8fc (patch) | |
| tree | 7073e8fdee52b63b30cac012d554bc823e3422b3 | |
| parent | c86e17d4be336286e31e8252b13b9f85d5a7b750 (diff) | |
| download | sphinx-git-6cdc09272e17dea0c7c6bc77f0cdcc0867a9e8fc.tar.gz | |
Fix #7120: html: crashed when on scaling SVG images which have float dimentions
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | sphinx/util/images.py | 2 |
2 files changed, 4 insertions, 0 deletions
@@ -16,6 +16,8 @@ Features added Bugs fixed ---------- +* #7120: html: crashed when on scaling SVG images which have float dimentions + Testing -------- diff --git a/sphinx/util/images.py b/sphinx/util/images.py index 4746e1c40..506e4a931 100644 --- a/sphinx/util/images.py +++ b/sphinx/util/images.py @@ -45,6 +45,8 @@ def get_image_size(filename: str) -> Tuple[int, int]: size = imagesize.get(filename) if size[0] == -1: size = None + elif isinstance(size[0], float) or isinstance(size[1], float): + size = (int(size[0]), int(size[1])) if size is None and Image: # fallback to Pillow im = Image.open(filename) |
