Merge pull request #6998 from Modelmat/adobe-illustrator-imgconverter

Adds support for Adobe Illustrator (.ai) to sphinx.ext.imgconverter
This commit is contained in:
Takeshi KOMIYA 2020-01-08 23:27:45 +09:00 committed by GitHub
commit 1eac74fa35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@ class ImagemagickConverter(ImageConverter):
('image/svg+xml', 'image/png'),
('image/gif', 'image/png'),
('application/pdf', 'image/png'),
('application/illustrator', 'image/png'),
]
def is_available(self) -> bool:

View File

@ -222,7 +222,6 @@ class ImageConverter(BaseImageConverter):
if '?' in node['candidates']:
return []
elif '*' in node['candidates']:
from sphinx.util.images import guess_mimetype
return [guess_mimetype(node['uri'])]
else:
return node['candidates'].keys()

View File

@ -32,6 +32,7 @@ mime_suffixes = OrderedDict([
('.pdf', 'application/pdf'),
('.svg', 'image/svg+xml'),
('.svgz', 'image/svg+xml'),
('.ai', 'application/illustrator'),
])
DataURI = NamedTuple('DataURI', [('mimetype', str),