-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
:scale: option of image/figure directive not working for SVG images in HTML builds #6696
Comments
Unfortunately, |
… working for SVG Note: imagesize-1.2.0 or above is required
Fix #6696: html: scale option of image/figure directive not working for SVG
Fixed by #6985 |
Thank you for the good work! |
Be aware, there are currently some issues with how "imagesize_py" handles SVG files. For example, my SVG |
Describe the bug
When including an SVG image, using the
.. image::
or.. figure::
directives, The:scale:
option (e.g.:scale: 50%
) appears to have no effect on the output of HTML builds.To reproduce
Steps to reproduce the behavior:
Include any SVG image in a sphinx document as follows:
Build the HTML version of the document:
Expected behaviour
The image in the HTML output is half the size as compared to when I am not using the option
:scale: 50%
.Actual behaviour
The
:scale: 50%
directive has no effect on the resultant HTML.Environment info
Sphinx was installed in a virtual python environment as follows:
This resulted in the following versions:
Here,
sphinxcontrib-svg2pdfconverter
is only needed to compare the HTML behaviour with a successful LaTeX build. The HTML issue itself can be recreated with Sphinx alone.Additional context
The
:scale:
option works as expected for SVG imgaes in latexpdf builds (in conjunction with this extension).The
:width:
and:height:
options, do work as expected for SVG images in HTML builds.The text was updated successfully, but these errors were encountered: