summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-02-14 01:03:22 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-02-14 01:03:22 +0900
commit4adcb408ea95bbd3dce111441c28730f59538eb6 (patch)
treea801a4f9f77329ba27c696a640d42281012e0b69
parent89c3c4ab5090f867cf49ce3c661d8459a6718cc4 (diff)
downloadsphinx-git-4adcb408ea95bbd3dce111441c28730f59538eb6.tar.gz
Fix #6019: imgconverter: Including multipage PDF fails
-rw-r--r--CHANGES1
-rw-r--r--sphinx/ext/imgconverter.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index ba2f15cb9..669c29062 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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 +