* [ISSUE] Rendering SVG in Emacs is broken when only viewBox attribute is given
@ 2024-01-20 20:26 smartmic
2025-02-03 0:31 ` ionutleca
0 siblings, 1 reply; 2+ messages in thread
From: smartmic @ 2024-01-20 20:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]
New issue by smartmic on void-packages repository
https://github.com/void-linux/void-packages/issues/48308
Description:
### Is this a new report?
Yes
### System Info
Void 6.6.11_1 x86_64 AuthenticAMD notuptodate rFF
### Package(s) Affected
emacs-gtk3-29.2_1
### Does a report exist for this bug with the project's home (upstream) and/or another distro?
_No response_
### Expected behaviour
Rendering SVG images which only have a `viewBox` specification should work.
### Actual behaviour
When I open an SVG file which has only a `viewBox` attribute and **no** `height` or `width` (perfectly valid SVG, renders fine on any SVG viewer and also with Emacs on other distros/platforms), only a small frame appears and no image is rendered. In buffer `*Messages*`, this (repeating) message appears:
```
Invalid image size (see ‘max-image-size’)
````
I shared more details on [Reddit](https://www.reddit.com/r/voidlinux/comments/19atapp/rendering_svg_in_emacs_is_broken/)
### Steps to reproduce
1. Try to display this SVG as image:
```
<svg style="font-family: Sans Serif;" xmlns='http://www.w3.org/2000/svg' viewBox="0 0 112.32 76.32">
<path d="M2.16,74.16L110.16,74.16L110.16,2.16L2.16,2.16Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="56.16" y="38.16" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">Hello</text>
</svg>
```
It will show only a small empty frame.
2. Change to text mode and add a `height` attribute with a value to the SVG:
```
<svg style="font-family: Sans Serif;" xmlns='http://www.w3.org/2000/svg' height="200" viewBox="0 0 112.32 76.32">
<path d="M2.16,74.16L110.16,74.16L110.16,2.16L2.16,2.16Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
<text x="56.16" y="38.16" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">Hello</text>
</svg>
```
3. Switch back to image mode, it will render fine
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Rendering SVG in Emacs is broken when only viewBox attribute is given
2024-01-20 20:26 [ISSUE] Rendering SVG in Emacs is broken when only viewBox attribute is given smartmic
@ 2025-02-03 0:31 ` ionutleca
0 siblings, 0 replies; 2+ messages in thread
From: ionutleca @ 2025-02-03 0:31 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 329 bytes --]
New comment by ionutleca on void-packages repository
https://github.com/void-linux/void-packages/issues/48308#issuecomment-2629653777
Comment:
Might be related to this:
https://lists.gnu.org/r/bug-gnu-emacs/2023-08/msg00261.html
Fixed here:
https://github.com/emacs-mirror/emacs/commit/66a3bb36f940d2f2a712d20aadaeda20b8792cff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-03 0:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-20 20:26 [ISSUE] Rendering SVG in Emacs is broken when only viewBox attribute is given smartmic
2025-02-03 0:31 ` ionutleca
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).