diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-02-14 01:03:22 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-02-14 01:03:22 +0900 |
commit | 4adcb408ea95bbd3dce111441c28730f59538eb6 (patch) | |
tree | a801a4f9f77329ba27c696a640d42281012e0b69 | |
parent | 89c3c4ab5090f867cf49ce3c661d8459a6718cc4 (diff) | |
download | sphinx-git-4adcb408ea95bbd3dce111441c28730f59538eb6.tar.gz |
Fix #6019: imgconverter: Including multipage PDF fails
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | sphinx/ext/imgconverter.py | 6 |
2 files changed, 4 insertions, 3 deletions
@@ -18,6 +18,7 @@ Bugs fixed * LaTeX: Remove extraneous space after author names on PDF title page (refs: #6004) * #6046: LaTeX: ``TypeError`` is raised when invalid latex_elements given +* #6019: imgconverter: Including multipage PDF fails Testing -------- diff --git a/sphinx/ext/imgconverter.py b/sphinx/ext/imgconverter.py index 79755d351..b0b379936 100644 --- a/sphinx/ext/imgconverter.py +++ b/sphinx/ext/imgconverter.py @@ -66,9 +66,9 @@ class ImagemagickConverter(ImageConverter): # type: (unicode, unicode) -> bool """Converts the image to expected one.""" try: - if _from.lower().endswith('.gif'): - # when target is GIF format, pick the first frame - _from += '[0]' + # append an index 0 to source filename to pick up the first frame + # (or first page) of image (ex. Animation GIF, PDF) + _from += '[0]' args = ([self.config.image_converter] + self.config.image_converter_args + |