Skip to content

Re: :scale: for SVG images in HTML builds #12415

Open
@tuncbkose

Description

@tuncbkose

Describe the bug

#6696 added :scale: support for SVGs. Since then, the implementation in imagesize has changed to contain a small bug I describe in shibukawa/imagesize_py#64. As a result, the image size is not obtained and scaling is ignored.

I'm creating this issue for the sake of visibility, in case others may encounter the same problem. I don't expect there is much to be done in the sphinx side, so feel free to close it.

How to Reproduce

Obtain an SVG file with single-quoted width/height (for example with dvisvgm). Then try to use the :scale: option

.. image:: example_image.svg
  :scale: 50%

Environment Information

Platform:              linux; (Linux-6.5.0-1023-oem-x86_64-with-glibc2.35)
Python version:        3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:45:18) [GCC 12.3.0])
Python implementation: CPython
Sphinx version:        5.3.0
Docutils version:      0.17.1
Jinja2 version:        3.1.4

but I don't think `sphinx`/`docutils` versions are relevant in this case.

Sphinx extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency filetype:bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions