From: smartmic <smartmic@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [ISSUE] Rendering SVG in Emacs is broken when only viewBox attribute is given
Date: Sat, 20 Jan 2024 21:26:23 +0100 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-48308@inbox.vuxu.org> (raw)
[-- 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
next reply other threads:[~2024-01-20 20:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-20 20:26 smartmic [this message]
2025-02-03 0:31 ` ionutleca
2025-02-18 11:12 ` [ISSUE] [CLOSED] " smartmic
2025-02-18 11:12 ` smartmic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-48308@inbox.vuxu.org \
--to=smartmic@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).