Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svgz not recognized in html output #3128

Closed
nowox opened this issue Nov 7, 2016 · 3 comments
Closed

svgz not recognized in html output #3128

nowox opened this issue Nov 7, 2016 · 3 comments

Comments

@nowox
Copy link

nowox commented Nov 7, 2016

I have my include as .. figure:: foo.* which I want to be expanded to "svgz", but it does not. I got the error:

None:None: WARNING: no matching candidate for image URI u'foo.*' 

However on visit_image in sphinx/writers/html.py I have this:

if uri.lower().endswith('svg') or uri.lower().endswith('svgz'):

From the mime_suffixes in sphinx/util/images.py the svgz extension is missing:

mime_suffixes = {
    '.pdf': 'application/pdf',
    '.svg': 'image/svg+xml',
}
@tk0miya
Copy link
Member

tk0miya commented Nov 21, 2016

I don't know this is a bug or feature enhancement.
But certainly it is very inconvenience if we can't use .svgz files to images.

So I'd like to add .svgz support into 1.5-release branch as a bug.
@shimizukawa how do you think?

Note:
W3C says mime-type for .svgz is "image/svg+xml".
https://www.w3.org/TR/SVG/intro.html#MIMEType

And the our documentation also says HTML builders supports "image/svg+xml".

supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg']
http://www.sphinx-doc.org/en/1.4.8/builders.html#sphinx.builders.html.StandaloneHTMLBuilder

It's not too much to say that this is a bug :-)

@tk0miya tk0miya added this to the 1.5 milestone Nov 21, 2016
@shimizukawa
Copy link
Member

+1 for including to 1.5-release

@tk0miya
Copy link
Member

tk0miya commented Dec 3, 2016

Fixed at b799249.
Thank you for reporting

@tk0miya tk0miya closed this as completed Dec 3, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants