Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] Rendering SVG in Emacs is broken when only viewBox attribute is given
@ 2024-01-20 20:26 smartmic
  0 siblings, 0 replies; only message 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] only message in thread

only message in thread, other threads:[~2024-01-20 20:26 UTC | newest]

Thread overview: (only message) (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

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).