unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64908: 29.1; svg parse failure
@ 2023-07-28  1:10 Daniel Vianna
  2023-07-28  6:05 ` Eli Zaretskii
  2023-08-03 19:16 ` David Ponce
  0 siblings, 2 replies; 32+ messages in thread
From: Daniel Vianna @ 2023-07-28  1:10 UTC (permalink / raw)
  To: 64908

[-- Attachment #1: Type: text/plain, Size: 45150 bytes --]

--text follows this line--

1. Compile emacs 29 with

```
sudo dnf builddep -y emacs
sudo dnf install -y libtree-sitter-devel wxBase-devel wxGTK3-devel
libwebp-devel

CC='CFLAGS=-DMAIL_USE_LOCKF -O2 -flto=auto -ffat-lto-objects -fexceptions
-g -grecord-gcc-switches -pipe -Wall -Werror=format-security
-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
LDFLAGS=-Wl,-z,relro gcc'
PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig

make distclean

git checkout emacs-29
git pull

./autogen.sh
./configure \
  --prefix=$HOME/.local \
  --without-pop \
  --with-mailutils \
  --with-pgtk \
  --without-x \
  --with-xwidgets \
  --with-cairo \
  --without-compress-install \
  --with-native-compilation \
  --with-json \
  --with-dbus \
  --with-gif \
  --with-jpeg \
  --with-png \
  --with-rsvg \
  --with-tiff \
  --with-webp \
  --with-gpm \
  --with-modules \
  --with-harfbuzz
  build_alias=x86_64-redhat-linux-gnu \
  host_alias=x86_64-redhat-linux-gnu

make -j8
make install
```

2. use the following minimal config:

```
;; Packages
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)

;; Treemacs
(use-package treemacs
  :init (treemacs))
```

3. Run emacs with
$ emacs --init-directory=$HOME/.emacs.d.off/init.el


4. Open ~/.local/share/emacs/29.1/etc/images/splash.svg

5. Open

~/.emacs.d.off/elpa/treemacs-20230719.2015/icons/default/vsc/dir-src-open.svg
or any other svg in that directory.

Desired result: Both 4. and 5. lead to images being rendered by emacs.
Actual result: Step 4. renders an image, step 5. does not.


In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38,
 cairo version 1.17.8) of 2023-07-27 built on jabuticaba
Repository revision: c2d95dd00e6cb0abaf4e7550f38c8c2c9ca22f2d
Repository branch: emacs-29
System Description: Fedora Linux 38 (Workstation Edition)

Configured using:
 'configure --prefix=/home/dmvianna/.local --without-pop
 --with-mailutils --with-pgtk --without-x --with-xwidgets --with-cairo
 --without-compress-install --with-native-compilation --with-json
 --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff
 --with-gpm --with-modules --with-harfbuzz'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER XIM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_AU.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Image[png]

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  server-mode: t
  envrc-global-mode: t
  envrc-mode: t
  emms-mode-line-mode: t
  emms-playing-time-display-mode: t
  emms-playing-time-mode: t
  corfu-terminal-mode: t
  corfu-history-mode: t
  corfu-popupinfo-mode: t
  global-corfu-mode: t
  corfu-mode: t
  marginalia-mode: t
  vertico-mode: t
  pdf-occur-global-minor-mode: t
  shell-dirtrack-mode: t
  dirvish-override-dired-mode: t
  drag-stuff-global-mode: t
  drag-stuff-mode: t
  which-key-mode: t
  treemacs-filewatch-mode: t
  treemacs-follow-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-mode: t
  winum-mode: t
  windmove-mode: t
  global-hl-line-mode: t
  pixel-scroll-precision-mode: t
  xterm-mouse-mode: t
  fido-vertical-mode: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  savehist-mode: t
  global-auto-revert-mode: t
  elpaca-use-package-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-mode: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/dmvianna/.config/emacs/elpaca/builds/aweshell/exec-path-from-shell
hides
/home/dmvianna/.config/emacs/elpaca/builds/exec-path-from-shell/exec-path-from-shell
/home/dmvianna/.config/emacs/elpaca/builds/eglot/eglot hides
/home/dmvianna/.config/emacs/elpa/eglot-1.15/eglot
/home/dmvianna/.config/emacs/elpaca/builds/eglot/eglot-autoloads hides
/home/dmvianna/.config/emacs/elpa/eglot-1.15/eglot-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/eldoc/eldoc hides
/home/dmvianna/.config/emacs/elpa/eldoc-1.14.0/eldoc
/home/dmvianna/.config/emacs/elpaca/builds/eldoc/eldoc-autoloads hides
/home/dmvianna/.config/emacs/elpa/eldoc-1.14.0/eldoc-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/embark/embark-org hides
/home/dmvianna/.config/emacs/elpa/embark-consult-0.7/embark-org
/home/dmvianna/.config/emacs/elpaca/builds/embark-consult/embark-consult
hides /home/dmvianna/.config/emacs/elpa/embark-consult-0.7/embark-consult
/home/dmvianna/.config/emacs/elpaca/builds/embark-consult/embark-consult-autoloads
hides
/home/dmvianna/.config/emacs/elpa/embark-consult-0.7/embark-consult-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult-xref hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult-xref
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult-info hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult-info
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult-imenu hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult-imenu
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult-autoloads hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult-kmacro hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult-kmacro
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult-flymake hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult-flymake
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult-org hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult-org
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult-compile hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult-compile
/home/dmvianna/.config/emacs/elpaca/builds/consult/consult-register hides
/home/dmvianna/.config/emacs/elpa/consult-0.34/consult-register
/home/dmvianna/.config/emacs/elpaca/builds/embark/embark-org hides
/home/dmvianna/.config/emacs/elpa/embark-0.22.1/embark-org
/home/dmvianna/.config/emacs/elpaca/builds/embark/embark-autoloads hides
/home/dmvianna/.config/emacs/elpa/embark-0.22.1/embark-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/embark/embark hides
/home/dmvianna/.config/emacs/elpa/embark-0.22.1/embark
/home/dmvianna/.config/emacs/elpaca/builds/epl/epl hides
/home/dmvianna/.config/emacs/elpa/epl-0.9/epl
/home/dmvianna/.config/emacs/elpaca/builds/epl/epl-autoloads hides
/home/dmvianna/.config/emacs/elpa/epl-0.9/epl-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-header-line
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-header-line
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-customization
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-customization
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-peek-mode
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-peek-mode
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-project-follow-mode
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-project-follow-mode
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-visuals hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-visuals
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-persistence
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-persistence
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-logging hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-logging
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-workspaces
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-workspaces
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-fringe-indicator
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-fringe-indicator
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-async hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-async
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-rendering
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-rendering
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-git-commit-diff-mode
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-git-commit-diff-mode
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-file-management
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-file-management
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-hydras hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-hydras
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-compatibility
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-compatibility
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-macros hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-macros
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-annotations
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-annotations
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-follow-mode
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-follow-mode
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-faces hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-faces
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-filewatch-mode
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-filewatch-mode
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-extensions
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-extensions
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-themes hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-themes
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-tag-follow-mode
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-tag-follow-mode
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-treelib hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-treelib
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-diagnostics
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-diagnostics
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-tags hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-tags
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-autoloads
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-icons hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-icons
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-scope hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-scope
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-mode hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-mode
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-interface
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-interface
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-bookmarks
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-bookmarks
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-dom hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-dom
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-mouse-interface
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-mouse-interface
/home/dmvianna/.config/emacs/elpaca/builds/treemacs/treemacs-core-utils
hides
/home/dmvianna/.config/emacs/elpa/treemacs-20230719.2015/treemacs-core-utils
/home/dmvianna/.config/emacs/elpaca/builds/cfrs/cfrs-autoloads hides
/home/dmvianna/.config/emacs/elpa/cfrs-20220129.1149/cfrs-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/cfrs/cfrs hides
/home/dmvianna/.config/emacs/elpa/cfrs-20220129.1149/cfrs
/home/dmvianna/.config/emacs/elpaca/builds/posframe/posframe-benchmark
hides
/home/dmvianna/.config/emacs/elpa/posframe-20230714.227/posframe-benchmark
/home/dmvianna/.config/emacs/elpaca/builds/posframe/posframe hides
/home/dmvianna/.config/emacs/elpa/posframe-20230714.227/posframe
/home/dmvianna/.config/emacs/elpaca/builds/posframe/posframe-autoloads
hides
/home/dmvianna/.config/emacs/elpa/posframe-20230714.227/posframe-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/ht/ht hides
/home/dmvianna/.config/emacs/elpa/ht-20230703.558/ht
/home/dmvianna/.config/emacs/elpaca/builds/ht/ht-autoloads hides
/home/dmvianna/.config/emacs/elpa/ht-20230703.558/ht-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/hydra/hydra hides
/home/dmvianna/.config/emacs/elpa/hydra-20220910.1206/hydra
/home/dmvianna/.config/emacs/elpaca/builds/hydra/hydra-ox hides
/home/dmvianna/.config/emacs/elpa/hydra-20220910.1206/hydra-ox
/home/dmvianna/.config/emacs/elpaca/builds/hydra/hydra-autoloads hides
/home/dmvianna/.config/emacs/elpa/hydra-20220910.1206/hydra-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/hydra/hydra-examples hides
/home/dmvianna/.config/emacs/elpa/hydra-20220910.1206/hydra-examples
/home/dmvianna/.config/emacs/elpaca/builds/lv/lv hides
/home/dmvianna/.config/emacs/elpa/lv-20200507.1518/lv
/home/dmvianna/.config/emacs/elpaca/builds/lv/lv-autoloads hides
/home/dmvianna/.config/emacs/elpa/lv-20200507.1518/lv-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/pfuture/pfuture hides
/home/dmvianna/.config/emacs/elpa/pfuture-20220913.1401/pfuture
/home/dmvianna/.config/emacs/elpaca/builds/pfuture/pfuture-autoloads hides
/home/dmvianna/.config/emacs/elpa/pfuture-20220913.1401/pfuture-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/ace-window/ace-window hides
/home/dmvianna/.config/emacs/elpa/ace-window-20220911.358/ace-window
/home/dmvianna/.config/emacs/elpaca/builds/ace-window/ace-window-posframe
hides
/home/dmvianna/.config/emacs/elpa/ace-window-20220911.358/ace-window-posframe
/home/dmvianna/.config/emacs/elpaca/builds/ace-window/ace-window-autoloads
hides
/home/dmvianna/.config/emacs/elpa/ace-window-20220911.358/ace-window-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/avy/avy hides
/home/dmvianna/.config/emacs/elpa/avy-20230420.404/avy
/home/dmvianna/.config/emacs/elpaca/builds/avy/avy-autoloads hides
/home/dmvianna/.config/emacs/elpa/avy-20230420.404/avy-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/s/s-autoloads hides
/home/dmvianna/.config/emacs/elpa/s-1.13.0/s-autoloads
/home/dmvianna/.config/emacs/elpaca/builds/s/s hides
/home/dmvianna/.config/emacs/elpa/s-1.13.0/s
/home/dmvianna/.config/emacs/elpa/dash-2.19.1/dash hides
/home/dmvianna/.config/emacs/elpaca/builds/dash/dash
/home/dmvianna/.config/emacs/elpa/dash-2.19.1/dash-autoloads hides
/home/dmvianna/.config/emacs/elpaca/builds/dash/dash-autoloads
/home/dmvianna/.config/emacs/elpa/compat-29.1.4.1/compat hides
/home/dmvianna/.config/emacs/elpaca/builds/compat/compat
/home/dmvianna/.config/emacs/elpa/compat-29.1.4.1/compat-macs hides
/home/dmvianna/.config/emacs/elpaca/builds/compat/compat-macs
/home/dmvianna/.config/emacs/elpa/compat-29.1.4.1/compat-29 hides
/home/dmvianna/.config/emacs/elpaca/builds/compat/compat-29
/home/dmvianna/.config/emacs/elpa/compat-29.1.4.1/compat-28 hides
/home/dmvianna/.config/emacs/elpaca/builds/compat/compat-28
/home/dmvianna/.config/emacs/elpa/compat-29.1.4.1/compat-25 hides
/home/dmvianna/.config/emacs/elpaca/builds/compat/compat-25
/home/dmvianna/.config/emacs/elpa/compat-29.1.4.1/compat-26 hides
/home/dmvianna/.config/emacs/elpaca/builds/compat/compat-26
/home/dmvianna/.config/emacs/elpa/compat-29.1.4.1/compat-autoloads hides
/home/dmvianna/.config/emacs/elpaca/builds/compat/compat-autoloads
/home/dmvianna/.config/emacs/elpa/compat-29.1.4.1/compat-27 hides
/home/dmvianna/.config/emacs/elpaca/builds/compat/compat-27
/home/dmvianna/.config/emacs/elpaca/builds/external-completion/external-completion
hides /home/dmvianna/.local/share/emacs/29.1/lisp/external-completion
/home/dmvianna/.config/emacs/elpaca/builds/transient/transient hides
/home/dmvianna/.local/share/emacs/29.1/lisp/transient
/home/dmvianna/.config/emacs/elpaca/builds/jsonrpc/jsonrpc hides
/home/dmvianna/.local/share/emacs/29.1/lisp/jsonrpc
/home/dmvianna/.config/emacs/elpaca/builds/eglot/eglot hides
/home/dmvianna/.local/share/emacs/29.1/lisp/progmodes/eglot
/home/dmvianna/.config/emacs/elpaca/builds/flymake/flymake hides
/home/dmvianna/.local/share/emacs/29.1/lisp/progmodes/flymake
/home/dmvianna/.config/emacs/elpaca/builds/xref/xref hides
/home/dmvianna/.local/share/emacs/29.1/lisp/progmodes/xref
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-css hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-css
/home/dmvianna/.config/emacs/elpaca/builds/org/org-crypt hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-crypt
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-koma-letter hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-koma-letter
/home/dmvianna/.config/emacs/elpaca/builds/org/org-macs hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-macs
/home/dmvianna/.config/emacs/elpaca/builds/org/org-datetree hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-datetree
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-beamer hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-beamer
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-eshell hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-eshell
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-haskell hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-haskell
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-docview hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-docview
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-shell hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-shell
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-eshell hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-eshell
/home/dmvianna/.config/emacs/elpaca/builds/org/org-macro hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-macro
/home/dmvianna/.config/emacs/elpaca/builds/org/org-list hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-list
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-processing hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-processing
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-icalendar hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-icalendar
/home/dmvianna/.config/emacs/elpaca/builds/org/ox hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox
/home/dmvianna/.config/emacs/elpaca/builds/org/org-lint hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-lint
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-bbdb hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-bbdb
/home/dmvianna/.config/emacs/elpaca/builds/org/org-pcomplete hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-pcomplete
/home/dmvianna/.config/emacs/elpaca/builds/org/org-timer hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-timer
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-calc hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-calc
/home/dmvianna/.config/emacs/elpaca/builds/org/org-agenda hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-agenda
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-rmail hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-rmail
/home/dmvianna/.config/emacs/elpaca/builds/org/org-indent hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-indent
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-gnus hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-gnus
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-w3m hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-w3m
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-sql hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-sql
/home/dmvianna/.config/emacs/elpaca/builds/org/org-table hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-table
/home/dmvianna/.config/emacs/elpaca/builds/org/org-entities hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-entities
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-js hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-js
/home/dmvianna/.config/emacs/elpaca/builds/org/org-goto hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-goto
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-latex hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-latex
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-comint hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-comint
/home/dmvianna/.config/emacs/elpaca/builds/org/org-keys hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-keys
/home/dmvianna/.config/emacs/elpaca/builds/org/org-tempo hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-tempo
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-awk hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-awk
/home/dmvianna/.config/emacs/elpaca/builds/org/org-attach-git hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-attach-git
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-fortran hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-fortran
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-sqlite hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-sqlite
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-publish hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-publish
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-org hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-org
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-matlab hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-matlab
/home/dmvianna/.config/emacs/elpaca/builds/org/org-loaddefs hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-loaddefs
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-irc hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-irc
/home/dmvianna/.config/emacs/elpaca/builds/org/ol hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol
/home/dmvianna/.config/emacs/elpaca/builds/org/org-capture hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-capture
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-lua hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-lua
/home/dmvianna/.config/emacs/elpaca/builds/org/oc hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/oc
/home/dmvianna/.config/emacs/elpaca/builds/org/org-fold hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-fold
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-octave hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-octave
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-ref hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-ref
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-julia hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-julia
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-screen hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-screen
/home/dmvianna/.config/emacs/elpaca/builds/org/org-src hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-src
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-groovy hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-groovy
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-lob hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-lob
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-exp hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-exp
/home/dmvianna/.config/emacs/elpaca/builds/org/oc-basic hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/oc-basic
/home/dmvianna/.config/emacs/elpaca/builds/org/org hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-mhe hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-mhe
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-perl hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-perl
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-ascii hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-ascii
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-latex hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-latex
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-ocaml hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-ocaml
/home/dmvianna/.config/emacs/elpaca/builds/org/org-num hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-num
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-html hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-html
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-java hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-java
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-dot hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-dot
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-tangle hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-tangle
/home/dmvianna/.config/emacs/elpaca/builds/org/org-cycle hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-cycle
/home/dmvianna/.config/emacs/elpaca/builds/org/org-feed hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-feed
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-man hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-man
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-clojure hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-clojure
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-forth hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-forth
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-bibtex hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-bibtex
/home/dmvianna/.config/emacs/elpaca/builds/org/org-clock hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-clock
/home/dmvianna/.config/emacs/elpaca/builds/org/org-footnote hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-footnote
/home/dmvianna/.config/emacs/elpaca/builds/org/org-faces hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-faces
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-org hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-org
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-sass hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-sass
/home/dmvianna/.config/emacs/elpaca/builds/org/org-compat hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-compat
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-eww hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-eww
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-lilypond hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-lilypond
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-texinfo hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-texinfo
/home/dmvianna/.config/emacs/elpaca/builds/org/org-archive hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-archive
/home/dmvianna/.config/emacs/elpaca/builds/org/org-mouse hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-mouse
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-emacs-lisp hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-emacs-lisp
/home/dmvianna/.config/emacs/elpaca/builds/org/oc-biblatex hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/oc-biblatex
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-python hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-python
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-maxima hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-maxima
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-odt hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-odt
/home/dmvianna/.config/emacs/elpaca/builds/org/org-id hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-id
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-table hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-table
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-info hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-info
/home/dmvianna/.config/emacs/elpaca/builds/org/org-ctags hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-ctags
/home/dmvianna/.config/emacs/elpaca/builds/org/org-element hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-element
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-lisp hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-lisp
/home/dmvianna/.config/emacs/elpaca/builds/org/org-persist hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-persist
/home/dmvianna/.config/emacs/elpaca/builds/org/org-protocol hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-protocol
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-ruby hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-ruby
/home/dmvianna/.config/emacs/elpaca/builds/org/org-fold-core hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-fold-core
/home/dmvianna/.config/emacs/elpaca/builds/org/org-mobile hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-mobile
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-scheme hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-scheme
/home/dmvianna/.config/emacs/elpaca/builds/org/ob hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob
/home/dmvianna/.config/emacs/elpaca/builds/org/org-plot hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-plot
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-core hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-core
/home/dmvianna/.config/emacs/elpaca/builds/org/oc-bibtex hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/oc-bibtex
/home/dmvianna/.config/emacs/elpaca/builds/org/org-habit hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-habit
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-ditaa hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-ditaa
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-sed hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-sed
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-gnuplot hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-gnuplot
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-R hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-R
/home/dmvianna/.config/emacs/elpaca/builds/org/ox-md hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ox-md
/home/dmvianna/.config/emacs/elpaca/builds/org/org-version hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-version
/home/dmvianna/.config/emacs/elpaca/builds/org/oc-natbib hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/oc-natbib
/home/dmvianna/.config/emacs/elpaca/builds/org/org-inlinetask hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-inlinetask
/home/dmvianna/.config/emacs/elpaca/builds/org/org-attach hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-attach
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-plantuml hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-plantuml
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-man hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-man
/home/dmvianna/.config/emacs/elpaca/builds/org/org-colview hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-colview
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-makefile hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-makefile
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-eval hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-eval
/home/dmvianna/.config/emacs/elpaca/builds/org/ob-C hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ob-C
/home/dmvianna/.config/emacs/elpaca/builds/org/ol-doi hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/ol-doi
/home/dmvianna/.config/emacs/elpaca/builds/org/org-duration hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-duration
/home/dmvianna/.config/emacs/elpaca/builds/org/org-refile hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/org-refile
/home/dmvianna/.config/emacs/elpaca/builds/org/oc-csl hides
/home/dmvianna/.local/share/emacs/29.1/lisp/org/oc-csl
/home/dmvianna/.config/emacs/elpaca/builds/let-alist/let-alist hides
/home/dmvianna/.local/share/emacs/29.1/lisp/emacs-lisp/let-alist
/home/dmvianna/.config/emacs/elpaca/builds/eldoc/eldoc hides
/home/dmvianna/.local/share/emacs/29.1/lisp/emacs-lisp/eldoc

Features:
(shadow mail-extr emacsbug ace-window avy magit-extras tide tide-lv
rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri
rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns
nxml-mode nxml-outln nxml-rap sgml-mode nxml-util nxml-enc xmltok
checkdoc lisp-mnt parinfer-rust-mode parinfer-rust-changes parinfer-rust
parinfer-rust-helper autoconf autoconf-mode abridge-diff magit-bookmark
magit-submodule magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff git-commit log-edit pcvs-util add-log magit-core
magit-autorevert magit-margin magit-transient magit-process with-editor
magit-mode magit-git magit-base mm-archive message sendmail yank-media
rfc822 mml mml-sec gnus-util mailabbrev gmm-utils mm-decode mm-bodies
mm-encode gnutls url-http mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
url-gw url-cache url-auth tramp-archive tramp-gvfs tramp-cache
time-stamp zeroconf find-dired elec-pair scala-mode
scala-mode-prettify-symbols scala-mode-imenu scala-mode-map
scala-mode-fontlock scala-mode-indent scala-mode-paragraph
scala-mode-syntax scala-mode-lib py-isort cl-print shortdoc help-fns
radix-tree cape-keyword display-line-numbers mule-util info-colors
rainbow-delimiters vc-git diff-mode face-remap server vundo undo-hl
envrc inheritenv verb js c-ts-common cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs mm-util mail-prsvr
url-queue org-roam-migrate org-roam-log org-roam-mode org-roam-capture
org-roam-id org-roam-node org-roam-db emacsql-sqlite-builtin sqlite
org-roam-utils org-roam-compat org-roam org-capture org-element
org-persist xdg avl-tree org-attach org-id org-refile emacsql-sqlite
emacsql-sqlite-common emacsql emacsql-compiler magit-section
cursor-sensor org-pandoc-import ob-python python ob-shell org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src
ob-comint org-pcomplete org-list org-faces org-entities ob-emacs-lisp
ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys
oc org-loaddefs cal-menu calendar cal-loaddefs org-version org-compat
org-macs mastodon shr pixel-fill kinsoku url-file svg dom
mastodon-search mastodon-toot facemenu mastodon-iso persist emojify
apropos tar-mode arc-mode archive-mode mastodon-http request mailheader
mail-utils emms-info-libtag emms-mpris dbus emms-librefm-stream xml
emms-librefm-scrobbler emms-playlist-limit emms-i18n emms-history
emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks
emms-cue emms-mode-line-icon emms-browser sort emms-volume
emms-volume-sndioctl emms-volume-mixerctl emms-volume-pulse
emms-volume-amixer emms-playlist-sort emms-last-played emms-player-xine
emms-player-mpd emms-lyrics emms-url emms-streams emms-show-all
emms-tag-editor emms-tag-tracktag emms-mark emms-mode-line emms-cache
emms-info-native emms-info-exiftool emms-info-tinytag emms-info-metaflac
emms-info-opusinfo emms-info-ogginfo emms-info-mp3info
emms-playlist-mode emms-player-vlc emms-player-mpv emms-playing-time
emms-info emms-later-do emms-player-mplayer emms-player-simple
emms-source-playlist emms-source-file locate emms-setup emms emms-compat
orderless consult-eglot consult-gh crm consult corfu-terminal popon
corfu-history corfu-popupinfo cape corfu marginalia vertico pdf-occur
tablist tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local cedet pdf-isearch
let-alist pdf-misc pdf-tools pdf-view treemacs-bookmarks bookmark
jka-compr pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif
bigquery-mode bqm-function-names bqm-names sql-indent sql udev-mode
yaml-mode lsp-metals view lsp-metals-treeview treemacs-extensions
treemacs-mouse-interface treemacs-tags lsp-metals-protocol lsp-lens
dap-mode dap-tasks dap-launch lsp-docker yaml posframe dap-overlays
lsp-diagnostics lsp-jedi lsp-haskell haskell-mode haskell-cabal
haskell-utils haskell-font-lock haskell-indentation haskell-string
haskell-sort-imports haskell-lexeme haskell-align-imports
haskell-complete-module haskell-ghc-support etags fileloop dabbrev
haskell-customize graphviz-dot-mode dockerfile-mode sh-script smie
treesit executable eglot external-completion flymake-proc flymake ert
debug backtrace jsonrpc lsp-treemacs lsp-mode lsp-protocol xref
tree-widget spinner network-stream puny nsm markdown-mode thingatpt
noutline outline lv imenu ewoc lsp-treemacs-generic lsp-treemacs-themes
f f-shortdoc treemacs-treelib google-this logview datetime extmap bindat
aweshell eshell-prompt-extras tramp tramp-loaddefs trampver
tramp-integration tramp-compat parse-time iso8601 time-date em-dirs
esh-var esh-mode em-ls eshell-up eshell esh-cmd generator esh-ext
esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
multi-term term disp-table shell pcomplete ehelp exec-path-from-shell rg
files-x vc vc-dispatcher rg-info-hack rg-menu rg-ibuffer rg-result
wgrep-rg wgrep rg-history rg-header ibuf-ext grep compile
text-property-search comint ansi-osc yasnippet aggressive-indent
flycheck ansi-color find-func highlight-indent-guides dirvish transient
format-spec compat dired-x dired dired-loaddefs smart-mode-line
rich-minority drag-stuff visual-regexp string-inflection delight
which-key all-the-icons all-the-icons-faces data-material
data-weathericons data-octicons data-fileicons data-faicons
data-alltheicons solarized-dark-theme solarized-theme solarized
solarized-faces treemacs treemacs-header-line treemacs-compatibility
treemacs-mode treemacs-interface treemacs-persistence
treemacs-filewatch-mode treemacs-follow-mode treemacs-rendering
treemacs-annotations treemacs-async treemacs-workspaces treemacs-dom
treemacs-visuals treemacs-fringe-indicator pulse treemacs-faces
treemacs-icons treemacs-scope treemacs-themes treemacs-core-utils
pfuture inline ht treemacs-logging treemacs-customization
treemacs-macros pcase s winum dash auto-compile comp comp-cstr warnings
envrc-autoloads verb-autoloads org-download-autoloads async-autoloads
org-journal-autoloads org-roam-autoloads emacsql-autoloads
org-pandoc-import-autoloads mastodon-autoloads ts-autoloads
persist-autoloads slack-autoloads emojify-autoloads alert-autoloads
log4e-autoloads gntp-autoloads circe-autoloads oauth2-autoloads
websocket-autoloads emms-autoloads orderless-autoloads
consult-eglot-autoloads corfu-terminal-autoloads popon-autoloads
corfu-history-autoloads corfu-popupinfo-autoloads cape-autoloads
corfu-autoloads marginalia-autoloads vertico-autoloads nov-autoloads
esxml-autoloads kv-autoloads pdf-tools-autoloads tablist-autoloads
bigquery-mode-autoloads sql-indent-autoloads hoon-mode-autoloads
udev-mode-autoloads terraform-mode-autoloads hcl-mode-autoloads
yaml-mode-autoloads theta-mode-autoloads lsp-metals-autoloads
sbt-mode-autoloads scala-mode-autoloads racket-mode-autoloads
nix-mode-autoloads lsp-jedi-autoloads python-black-autoloads
py-isort-autoloads parinfer-rust-mode-autoloads slime-autoloads
macrostep-autoloads pickle-autoloads tide-autoloads
tree-sitter-langs-autoloads tree-sitter-autoloads tsc-autoloads
typescript-mode-autoloads prettier-js-autoloads web-mode-autoloads
lsp-java-autoloads dap-mode-autoloads lsp-docker-autoloads
yaml-autoloads bui-autoloads request-autoloads json-mode-autoloads rx
json-snatcher-autoloads lsp-haskell-autoloads haskell-mode-autoloads
graphviz-dot-mode-autoloads elm-mode-autoloads dockerfile-mode-autoloads
dhall-mode-autoloads reformatter-autoloads csv-mode-autoloads
external-completion-autoloads xref-autoloads jsonrpc-autoloads
lsp-treemacs-autoloads lsp-ui-autoloads lsp-mode-autoloads
markdown-mode-autoloads spinner-autoloads f-autoloads
google-this-autoloads logview-autoloads datetime-autoloads
extmap-autoloads consult-gh-autoloads gh-autoloads marshal-autoloads
logito-autoloads pcache-autoloads abridge-diff-autoloads
aweshell-autoloads multi-term-autoloads exec-path-from-shell-autoloads
dumb-jump-autoloads popup-autoloads rg-autoloads wgrep-autoloads
vundo-autoloads undo-hl-autoloads puni-autoloads origami-autoloads
yasnippet-autoloads format-all-autoloads language-id-autoloads
inheritenv-autoloads aggressive-indent-autoloads flycheck-autoloads
let-alist-autoloads pkg-info-autoloads flymake-autoloads
highlight-indent-guides-autoloads rainbow-delimiters-autoloads
dirvish-autoloads transient-autoloads smart-mode-line-autoloads
rich-minority-autoloads drag-stuff-autoloads ibuffer-vc-autoloads
multiple-cursors-autoloads visual-regexp-steroids-autoloads
visual-regexp-autoloads string-inflection-autoloads delight-autoloads
which-key-autoloads info-colors-autoloads immortal-scratch-autoloads
all-the-icons-dired-autoloads all-the-icons-autoloads
solarized-theme-autoloads winum-autoloads auto-compile-autoloads
gcmh-autoloads init early-modes.el project org-config.el
communication.el minibuffers orderless-config consult-config viewers
languages scala-config python-config web-config haskell-config
csv-config color cl dev ediff ediff-merg ediff-mult ediff-wind
ediff-diff ediff-help ediff-init ediff-util edmacro kmacro advice ui
ibuffer ibuffer-loaddefs windmove hl-line cus-edit pp cus-load icons
wid-edit pixel-scroll cua-base ring xt-mouse icomplete custom.el
epa-file epa derived epg rfc6068 epg-config savehist autorevert
filenotify finder-inf eglot-autoloads eldoc-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
epl-autoloads treemacs-autoloads cfrs-autoloads posframe-autoloads
ht-autoloads hydra-autoloads lv-autoloads pfuture-autoloads
ace-window-autoloads avy-autoloads s-autoloads info package browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source eieio eieio-core password-cache json subr-x map byte-opt
url-vars elpaca-use-package magit-autoloads magit-section-autoloads
git-commit-autoloads with-editor-autoloads dash-autoloads
compat-autoloads system-packages-autoloads elpaca-use-package-autoloads
use-package-ensure-system-package use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode cl-extra help-mode use-package-core bytecomp byte-compile
cl-seq cl-macs gv elpaca elpaca-process cl-loaddefs cl-lib
elpaca-autoloads early-init rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads xwidget-internal dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
gtk pgtk multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 1317608 661751)
 (symbols 48 70847 6)
 (strings 32 401100 65481)
 (string-bytes 1 14057865)
 (vectors 16 130923)
 (vector-slots 8 2516596 555855)
 (floats 8 1464 3633)
 (intervals 56 10494 2824)
 (buffers 984 58))

[-- Attachment #2: Type: text/html, Size: 47073 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-07-28  1:10 bug#64908: 29.1; svg parse failure Daniel Vianna
@ 2023-07-28  6:05 ` Eli Zaretskii
       [not found]   ` <CAMLJ+NHO38NYGPctAj9MmMwy4tz8aSqHgLDWQhQaDm7FUP7Yqw@mail.gmail.com>
  2023-08-03 19:16 ` David Ponce
  1 sibling, 1 reply; 32+ messages in thread
From: Eli Zaretskii @ 2023-07-28  6:05 UTC (permalink / raw)
  To: Daniel Vianna; +Cc: 64908

> From: Daniel Vianna <dmlvianna@gmail.com>
> Date: Fri, 28 Jul 2023 11:10:45 +1000
> 
> 1. Compile emacs 29 with 
> 
> ```
> sudo dnf builddep -y emacs
> sudo dnf install -y libtree-sitter-devel wxBase-devel wxGTK3-devel libwebp-devel
> 
> CC='CFLAGS=-DMAIL_USE_LOCKF -O2 -flto=auto -ffat-lto-objects -fexceptions -g -
> grecord-gcc-switches -pipe -Wall -Werror=format-security -
> Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -
> specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -
> specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -
> fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
> LDFLAGS=-Wl,-z,relro gcc'
> PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig

I don't think Emacs supports FLTO (but I'm not sure that's related to
the problem you report, either).

> 3. Run emacs with 
> $ emacs --init-directory=$HOME/.emacs.d.off/init.el
> 
> 4. Open ~/.local/share/emacs/29.1/etc/images/splash.svg
> 
> 5. Open
>     ~/.emacs.d.off/elpa/treemacs-20230719.2015/icons/default/vsc/dir-src-open.svg
> or any other svg in that directory.
> 
> Desired result: Both 4. and 5. lead to images being rendered by emacs.
> Actual result: Step 4. renders an image, step 5. does not.

I tried a couple of SVG files from that distribution, and I have no
problems displaying them in Emacs 29.  But I did that in "emacs -Q"
without loading treemacs

My suggestions:

  . try visiting the images in "emacs -Q"
  . if "emacs -Q" still shows the problem, try building Emacs 29.1
    with the default configuration switches, and see if the problem
    persists when you do not load treemacs, in "emacs -Q"
  . if the problem persists in the default build, it could be due to
    the version of librsvg you have installed, so try to upgrade it or
    downgrade it

If none of the above helps, I guess we'll need some SVG expert around
here to see what is special about those problematic SVG images.

Thanks.





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
       [not found]   ` <CAMLJ+NHO38NYGPctAj9MmMwy4tz8aSqHgLDWQhQaDm7FUP7Yqw@mail.gmail.com>
@ 2023-07-28 11:00     ` Eli Zaretskii
  2023-07-28 12:48       ` Visuwesh
  0 siblings, 1 reply; 32+ messages in thread
From: Eli Zaretskii @ 2023-07-28 11:00 UTC (permalink / raw)
  To: Daniel Vianna; +Cc: 64908

> From: Daniel Vianna <dmlvianna@gmail.com>
> Date: Fri, 28 Jul 2023 17:08:00 +1000
> 
> Hi, Eli.
> 
> Thank you for your thorough response.
> 
> I have built emacs with `./configure` and no special environment variables, and used emacs -Q
> path/to/svg. No changes in behaviour.
> 
> What's striking is that 
> 1. Emacs opens other SVGs, and
> 2. Other applications in my OS also open the offending SVGs without issue, which suggests (but does
> not prove) that librsvg2 is not where the problem lies.
> 
> I'm going to leave it as that, as I don't think I can conveniently upgrade/downgrade librsvg2 with
> impunity in my distribution. But out of curiosity, which version are you using? And would anyone
> reading this thread and running Fedora be able to reproduce/not reproduce this issue?

My librsvg version is 2.40.1.  What version do you have installed?

Can someone who uses a newer librsvg please try those SVG files and
report back?

Thanks.





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-07-28 11:00     ` Eli Zaretskii
@ 2023-07-28 12:48       ` Visuwesh
  2023-08-03  8:11         ` Eli Zaretskii
  0 siblings, 1 reply; 32+ messages in thread
From: Visuwesh @ 2023-07-28 12:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Daniel Vianna, 64908

[வெள்ளி ஜூலை 28, 2023] Eli Zaretskii wrote:
> My librsvg version is 2.40.1.  What version do you have installed?
>
> Can someone who uses a newer librsvg please try those SVG files and
> report back?

I have librsvg 2.54.5 and I can open the files "dir-src-open.svg" [1]
and "dir-public-open.svg" [2] just fine in Emacs 29.1-rc1.

    % apt show librsvg2-2
    Package: librsvg2-2
    Version: 2.54.5+dfsg-3
    Priority: optional
    Section: libs
    Source: librsvg
    Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>

> Thanks.

1. https://raw.githubusercontent.com/Alexander-Miller/treemacs/master/icons/default/vsc/dir-src-open.svg
2. https://raw.githubusercontent.com/Alexander-Miller/treemacs/master/icons/default/vsc/dir-public-open.svg





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-07-28 12:48       ` Visuwesh
@ 2023-08-03  8:11         ` Eli Zaretskii
  0 siblings, 0 replies; 32+ messages in thread
From: Eli Zaretskii @ 2023-08-03  8:11 UTC (permalink / raw)
  To: Visuwesh; +Cc: dmlvianna, 64908

tags 64908 unreproducible
thanks

> From: Visuwesh <visuweshm@gmail.com>
> Cc: Daniel Vianna <dmlvianna@gmail.com>,  64908@debbugs.gnu.org
> Date: Fri, 28 Jul 2023 18:18:20 +0530
> 
> [வெள்ளி ஜூலை 28, 2023] Eli Zaretskii wrote:
> > My librsvg version is 2.40.1.  What version do you have installed?
> >
> > Can someone who uses a newer librsvg please try those SVG files and
> > report back?
> 
> I have librsvg 2.54.5 and I can open the files "dir-src-open.svg" [1]
> and "dir-public-open.svg" [2] just fine in Emacs 29.1-rc1.

Thanks.  I guess we'll need to wait until someone could reproduce and
tell more about what happens there.





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-07-28  1:10 bug#64908: 29.1; svg parse failure Daniel Vianna
  2023-07-28  6:05 ` Eli Zaretskii
@ 2023-08-03 19:16 ` David Ponce
  2023-08-04  5:23   ` Eli Zaretskii
  1 sibling, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-03 19:16 UTC (permalink / raw)
  To: 64908

[-- Attachment #1: Type: text/plain, Size: 2752 bytes --]

Hello,

In case it could help, using emacs from master (see details at end
below), with librsvg2-2.56.0-1.fc38.x86_64 I can insert-image
dir-src-open.svg and dir-public-open.svg in the *scratch-buffer*
without issue (see Screenshot1).

However, the same failed using librsvg2-2.56.3-1.fc38.x86_64 (see
Screenshot2).

I did test also with some KDE breeze icons.

No issue with librsvg2-2.56.0-1.fc38.x86_64.

With librsvg2-2.56.3-1.fc38.x86_64 some icons works, some not (see an
example in Screenshot3):

/usr/share/icons/breeze/actions/22/go-next.svg doesn't work:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
   <defs id="defs3051">
     <style type="text/css" id="current-color-scheme">
       .ColorScheme-Text {
         color:#232629;
       }
       </style>
   </defs>
  <path
     style="fill:currentColor;fill-opacity:1;stroke:none"
	d="m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125"
     class="ColorScheme-Text"
     />
</svg>

/usr/share/icons/breeze/actions/22/go-next.svg works:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
   <defs id="defs3051">
     <style type="text/css" id="current-color-scheme">
       .ColorScheme-Text {
         color:#232629;
       }
       </style>
   </defs>
   <g transform="translate(1,1)">
     <path style="fill:currentColor;fill-opacity:1;stroke:none" d="m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125" class="ColorScheme-Text"/>
   </g>
</svg>

As far as I can see, other applications (Gwenview, Geeqie, Firefox) don't have
problem to display the same images with librsvg2-2.56.3-1.fc38.x86_64 installed.

Hope it will help.
Regards

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
  3.24.38, cairo version 1.17.8) of 2023-07-31 built on kilauea
Repository revision: 18b176280db58932f7a321a1c7af3863b3e9f67a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 38 (KDE Plasma)

Configured using:
  'configure --with-x-toolkit=gtk3
  --with-native-compilation=no
  PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
   value of $LC_TIME: fr_FR.utf8
   value of $LANG: fr_FR.UTF-8
   locale-coding-system: utf-8-unix

[-- Attachment #2: Screenshot1.png --]
[-- Type: image/png, Size: 41436 bytes --]

[-- Attachment #3: Screenshot2.png --]
[-- Type: image/png, Size: 38997 bytes --]

[-- Attachment #4: Screenshot3.png --]
[-- Type: image/png, Size: 40277 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-03 19:16 ` David Ponce
@ 2023-08-04  5:23   ` Eli Zaretskii
  2023-08-04  7:55     ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: Eli Zaretskii @ 2023-08-04  5:23 UTC (permalink / raw)
  To: David Ponce; +Cc: 64908

> Date: Thu, 3 Aug 2023 21:16:35 +0200
> From: David Ponce <da_vid@orange.fr>
> 
> In case it could help, using emacs from master (see details at end
> below), with librsvg2-2.56.0-1.fc38.x86_64 I can insert-image
> dir-src-open.svg and dir-public-open.svg in the *scratch-buffer*
> without issue (see Screenshot1).
> 
> However, the same failed using librsvg2-2.56.3-1.fc38.x86_64 (see
> Screenshot2).
> 
> I did test also with some KDE breeze icons.
> 
> No issue with librsvg2-2.56.0-1.fc38.x86_64.
> 
> With librsvg2-2.56.3-1.fc38.x86_64 some icons works, some not (see an
> example in Screenshot3):
> 
> /usr/share/icons/breeze/actions/22/go-next.svg doesn't work:
> 
> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
>    <defs id="defs3051">
>      <style type="text/css" id="current-color-scheme">
>        .ColorScheme-Text {
>          color:#232629;
>        }
>        </style>
>    </defs>
>   <path
>      style="fill:currentColor;fill-opacity:1;stroke:none"
> 	d="m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125"
>      class="ColorScheme-Text"
>      />
> </svg>
> 
> /usr/share/icons/breeze/actions/22/go-next.svg works:
> 
> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
>    <defs id="defs3051">
>      <style type="text/css" id="current-color-scheme">
>        .ColorScheme-Text {
>          color:#232629;
>        }
>        </style>
>    </defs>
>    <g transform="translate(1,1)">
>      <path style="fill:currentColor;fill-opacity:1;stroke:none" d="m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125" class="ColorScheme-Text"/>
>    </g>
> </svg>
> 
> As far as I can see, other applications (Gwenview, Geeqie, Firefox) don't have
> problem to display the same images with librsvg2-2.56.3-1.fc38.x86_64 installed.

Thanks, this helps.

When an image fails to display, do you see any error messages from
librsvg?  Those are usually emitted to stderr, so perhaps you need to
run Emacs in a way that stderr is not discarded, but either shown on
the terminal or written to a file.





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-04  5:23   ` Eli Zaretskii
@ 2023-08-04  7:55     ` David Ponce
  2023-08-04 10:26       ` Eli Zaretskii
  0 siblings, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-04  7:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64908

[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]

On 04/08/2023 07:23, Eli Zaretskii wrote:
>> Date: Thu, 3 Aug 2023 21:16:35 +0200
>> From: David Ponce <da_vid@orange.fr>
>>
>> In case it could help, using emacs from master (see details at end
>> below), with librsvg2-2.56.0-1.fc38.x86_64 I can insert-image
>> dir-src-open.svg and dir-public-open.svg in the *scratch-buffer*
>> without issue (see Screenshot1).
>>
>> However, the same failed using librsvg2-2.56.3-1.fc38.x86_64 (see
>> Screenshot2).
>>
>> I did test also with some KDE breeze icons.
>>
>> No issue with librsvg2-2.56.0-1.fc38.x86_64.
>>
>> With librsvg2-2.56.3-1.fc38.x86_64 some icons works, some not (see an
>> example in Screenshot3):
>>
>> /usr/share/icons/breeze/actions/22/go-next.svg doesn't work:
>>
[...]
>>
>> /usr/share/icons/breeze/actions/22/go-next.svg works:
>>
[...]
>>
>> As far as I can see, other applications (Gwenview, Geeqie, Firefox) don't have
>> problem to display the same images with librsvg2-2.56.3-1.fc38.x86_64 installed.
> 
> Thanks, this helps.
> 
> When an image fails to display, do you see any error messages from
> librsvg?  Those are usually emitted to stderr, so perhaps you need to
> run Emacs in a way that stderr is not discarded, but either shown on
> the terminal or written to a file.

Hello ELi,

I don't see any message on stderr, but a bunch of messages:
"Invalid image size (see ‘max-image-size’)" in the *Messages* buffer,
probably related to the display of an invalid image (empty square)
in the *scratch* buffer. Also, the result of image-size is not the
expected image size (22x22 px in example). I attached a screenshot.

Thanks

[-- Attachment #2: Screenshot.png --]
[-- Type: image/png, Size: 148177 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-04  7:55     ` David Ponce
@ 2023-08-04 10:26       ` Eli Zaretskii
  2023-08-04 16:23         ` David Ponce
  2023-08-04 18:32         ` Alan Third
  0 siblings, 2 replies; 32+ messages in thread
From: Eli Zaretskii @ 2023-08-04 10:26 UTC (permalink / raw)
  To: David Ponce, Alan Third; +Cc: 64908

> Date: Fri, 4 Aug 2023 09:55:03 +0200
> Cc: 64908@debbugs.gnu.org
> From: David Ponce <da_vid@orange.fr>
> 
> On 04/08/2023 07:23, Eli Zaretskii wrote:
> >> Date: Thu, 3 Aug 2023 21:16:35 +0200
> >> From: David Ponce <da_vid@orange.fr>
> >>
> >> In case it could help, using emacs from master (see details at end
> >> below), with librsvg2-2.56.0-1.fc38.x86_64 I can insert-image
> >> dir-src-open.svg and dir-public-open.svg in the *scratch-buffer*
> >> without issue (see Screenshot1).
> >>
> >> However, the same failed using librsvg2-2.56.3-1.fc38.x86_64 (see
> >> Screenshot2).
> >>
> >> I did test also with some KDE breeze icons.
> >>
> >> No issue with librsvg2-2.56.0-1.fc38.x86_64.
> >>
> >> With librsvg2-2.56.3-1.fc38.x86_64 some icons works, some not (see an
> >> example in Screenshot3):
> >>
> >> /usr/share/icons/breeze/actions/22/go-next.svg doesn't work:
> >>
> [...]
> >>
> >> /usr/share/icons/breeze/actions/22/go-next.svg works:
> >>
> [...]
> >>
> >> As far as I can see, other applications (Gwenview, Geeqie, Firefox) don't have
> >> problem to display the same images with librsvg2-2.56.3-1.fc38.x86_64 installed.
> > 
> > Thanks, this helps.
> > 
> > When an image fails to display, do you see any error messages from
> > librsvg?  Those are usually emitted to stderr, so perhaps you need to
> > run Emacs in a way that stderr is not discarded, but either shown on
> > the terminal or written to a file.
> 
> Hello ELi,
> 
> I don't see any message on stderr, but a bunch of messages:
> "Invalid image size (see ‘max-image-size’)" in the *Messages* buffer,
> probably related to the display of an invalid image (empty square)
> in the *scratch* buffer. Also, the result of image-size is not the
> expected image size (22x22 px in example). I attached a screenshot.

Thanks.  I hope this will help an SVG expert to figure out what's
going on with these images.

Alan, do you have time to look into this, per chance?





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-04 10:26       ` Eli Zaretskii
@ 2023-08-04 16:23         ` David Ponce
  2023-08-04 18:32         ` Alan Third
  1 sibling, 0 replies; 32+ messages in thread
From: David Ponce @ 2023-08-04 16:23 UTC (permalink / raw)
  To: Eli Zaretskii, Alan Third; +Cc: 64908

On 04/08/2023 12:26, Eli Zaretskii wrote:
>> Date: Fri, 4 Aug 2023 09:55:03 +0200
>> Cc: 64908@debbugs.gnu.org
>> From: David Ponce <da_vid@orange.fr>
>>
>> On 04/08/2023 07:23, Eli Zaretskii wrote:
>>>> Date: Thu, 3 Aug 2023 21:16:35 +0200
>>>> From: David Ponce <da_vid@orange.fr>
>>>>
>>>> In case it could help, using emacs from master (see details at end
>>>> below), with librsvg2-2.56.0-1.fc38.x86_64 I can insert-image
>>>> dir-src-open.svg and dir-public-open.svg in the *scratch-buffer*
>>>> without issue (see Screenshot1).
>>>>
>>>> However, the same failed using librsvg2-2.56.3-1.fc38.x86_64 (see
>>>> Screenshot2).
>>>>
>>>> I did test also with some KDE breeze icons.
>>>>
>>>> No issue with librsvg2-2.56.0-1.fc38.x86_64.
>>>>
>>>> With librsvg2-2.56.3-1.fc38.x86_64 some icons works, some not (see an
>>>> example in Screenshot3):
>>>>
>>>> /usr/share/icons/breeze/actions/22/go-next.svg doesn't work:
>>>>
>> [...]
>>>>
>>>> /usr/share/icons/breeze/actions/22/go-next.svg works:
>>>>
>> [...]
>>>>
>>>> As far as I can see, other applications (Gwenview, Geeqie, Firefox) don't have
>>>> problem to display the same images with librsvg2-2.56.3-1.fc38.x86_64 installed.
>>>
>>> Thanks, this helps.
>>>
>>> When an image fails to display, do you see any error messages from
>>> librsvg?  Those are usually emitted to stderr, so perhaps you need to
>>> run Emacs in a way that stderr is not discarded, but either shown on
>>> the terminal or written to a file.
>>
>> Hello ELi,
>>
>> I don't see any message on stderr, but a bunch of messages:
>> "Invalid image size (see ‘max-image-size’)" in the *Messages* buffer,
>> probably related to the display of an invalid image (empty square)
>> in the *scratch* buffer. Also, the result of image-size is not the
>> expected image size (22x22 px in example). I attached a screenshot.
> 
> Thanks.  I hope this will help an SVG expert to figure out what's
> going on with these images.
> 
> Alan, do you have time to look into this, per chance?

I investigated further the issue with GDB, with a break in
svg_load_image in image.c, trying to display the image
"/usr/share/icons/breeze/actions/22/go-next.svg":

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
    <defs id="defs3051">
      <style type="text/css" id="current-color-scheme">
        .ColorScheme-Text {
          color:#232629;
        }
        </style>
    </defs>
   <path
      style="fill:currentColor;fill-opacity:1;stroke:none"
	d="m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125"
      class="ColorScheme-Text"
      />
</svg>

I think the problem is after the call to
rsvg_handle_get_intrinsic_dimensions at line 11354 in image.c.
Here is the relevant portion of code:

       rsvg_handle_get_intrinsic_dimensions (rsvg_handle,
                                             &has_width, &iwidth,
                                             &has_height, &iheight,
                                             &has_viewbox, &viewbox);

       if (has_width && has_height)
         {
           /* Success!  We can use these values directly.  */
           viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
                                                     img->face_font_size);
           viewbox_height = svg_css_length_to_pixels (iheight, dpi,
                                                      img->face_font_size);

           /* Here one dimension could be zero because in percent unit.
              So calculate this dimension with the other.  */
           if (! (0 < viewbox_width) && (iwidth.unit == RSVG_UNIT_PERCENT))
             viewbox_width = (viewbox_height * viewbox.width / viewbox.height)
               * iwidth.length;
           else if (! (0 < viewbox_height) && (iheight.unit == RSVG_UNIT_PERCENT))
             viewbox_height = (viewbox_width * viewbox.height / viewbox.width)
               * iheight.length;
         }

After the call to rsvg_handle_get_intrinsic_dimensions, the returned
values are:

(gdb) print has_width
$8 = 1
(gdb) print iwidth
$9 = {length = 1, unit = RSVG_UNIT_PERCENT}
(gdb) print iheight
$10 = {length = 1, unit = RSVG_UNIT_PERCENT}
(gdb) print viewbox
$11 = {x = 0, y = 0, width = 22, height = 22}

has_width and has_height are both 1 with iwidth and iheight set to
100%.  has_viewbox is also set to 1, and viewport contains the
dimensions of the image (22x22 pixels).

Then, the code matching "if (has_width && has_height)" is executed,
which, in this case, sets both viewbox_width and viewbox_height to 0,
which further leads to an image_size_error.

Maybe, it is due to a change of specifications since librsvg 2.54.0.

Here is what the spec I found at
<https://gnome.pages.gitlab.gnome.org/librsvg/Rsvg-2.0/method.Handle.get_intrinsic_dimensions.html>
says:

-----
Before librsvg 2.54.0, the out_has_width and out_has_height arguments
would be set to true or false depending on whether the SVG document
actually had width and height attributes, respectively.

However, since librsvg 2.54.0, width and height are now geometry
properties per the SVG2 specification; they are not plain
attributes. SVG2 made it so that the initial value of those properties
is auto, which is equivalent to specifing a value of 100%. In this
sense, even SVG documents which lack width or height attributes
semantically have to make them default to 100%. This is why since
librsvg 2.54.0, out_has_width and out_has_heigth are always returned
as TRUE, since with SVG2 all documents have a default width and height
of 100%.

As an example, the following SVG element has a width of 100 pixels and
a height of 400 pixels, but no viewBox. This function will return
those sizes in out_width and out_height, and set out_has_viewbox to
FALSE.

<svg xmlns="http://www.w3.org/2000/svg" width="100" height="400">

Conversely, the following element has a viewBox, but no width or
height. This function will set out_has_viewbox to TRUE, and it will
also set out_has_width and out_has_height to TRUE but return both
length values as 100%.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 400">
-----

I hope it will help an SVG expert to fix the issue.

Thanks
  









^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-04 10:26       ` Eli Zaretskii
  2023-08-04 16:23         ` David Ponce
@ 2023-08-04 18:32         ` Alan Third
  2023-08-04 19:08           ` Eli Zaretskii
  1 sibling, 1 reply; 32+ messages in thread
From: Alan Third @ 2023-08-04 18:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: David Ponce, 64908

On Fri, Aug 04, 2023 at 01:26:45PM +0300, Eli Zaretskii wrote:
> 
> Thanks.  I hope this will help an SVG expert to figure out what's
> going on with these images.
> 
> Alan, do you have time to look into this, per chance?

Yeah. I know roughly what needs to be done here thanks to David's most
recent email, but I'll have a wee think about how best to do it since
we already have, I think, three different methods of finding the image
size depending on the version of librsvg. If I can merge a couple of
those approaches it will probably be best.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-04 18:32         ` Alan Third
@ 2023-08-04 19:08           ` Eli Zaretskii
  2023-08-04 21:08             ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: Eli Zaretskii @ 2023-08-04 19:08 UTC (permalink / raw)
  To: Alan Third; +Cc: da_vid, 64908

> Date: Fri, 4 Aug 2023 19:32:13 +0100
> From: Alan Third <alan@idiocy.org>
> Cc: David Ponce <da_vid@orange.fr>, 64908@debbugs.gnu.org
> 
> On Fri, Aug 04, 2023 at 01:26:45PM +0300, Eli Zaretskii wrote:
> > 
> > Thanks.  I hope this will help an SVG expert to figure out what's
> > going on with these images.
> > 
> > Alan, do you have time to look into this, per chance?
> 
> Yeah. I know roughly what needs to be done here thanks to David's most
> recent email, but I'll have a wee think about how best to do it since
> we already have, I think, three different methods of finding the image
> size depending on the version of librsvg. If I can merge a couple of
> those approaches it will probably be best.

Thanks in advance.





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-04 19:08           ` Eli Zaretskii
@ 2023-08-04 21:08             ` David Ponce
  2023-08-05  8:30               ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-04 21:08 UTC (permalink / raw)
  To: Eli Zaretskii, Alan Third; +Cc: 64908

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

On 04/08/2023 21:08, Eli Zaretskii wrote:
>> Date: Fri, 4 Aug 2023 19:32:13 +0100
>> From: Alan Third <alan@idiocy.org>
>> Cc: David Ponce <da_vid@orange.fr>, 64908@debbugs.gnu.org
>>
>> On Fri, Aug 04, 2023 at 01:26:45PM +0300, Eli Zaretskii wrote:
>>>
>>> Thanks.  I hope this will help an SVG expert to figure out what's
>>> going on with these images.
>>>
>>> Alan, do you have time to look into this, per chance?
>>
>> Yeah. I know roughly what needs to be done here thanks to David's most
>> recent email, but I'll have a wee think about how best to do it since
>> we already have, I think, three different methods of finding the image
>> size depending on the version of librsvg. If I can merge a couple of
>> those approaches it will probably be best.
> 
> Thanks in advance.

Eli, Alan,

Until Alan finds the best solution, the attached simple patch fixed
the issue for me with librsvg 2.56.3.

Thanks & Regards

[-- Attachment #2: image.c.patch --]
[-- Type: text/x-patch, Size: 695 bytes --]

diff --git a/src/image.c b/src/image.c
index cb9725892d1..5abdcf710d1 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11356,6 +11356,16 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 					    &has_height, &iheight,
 					    &has_viewbox, &viewbox);
 
+# if LIBRSVG_CHECK_VERSION (2, 54, 0)
+      if (has_viewbox && has_width && has_height
+	  && (iwidth.length == 1) && (iwidth.unit == RSVG_UNIT_PERCENT)
+	  && (iwidth.length == 1) && (iheight.unit == RSVG_UNIT_PERCENT))
+	{
+	  viewbox_width = viewbox.width;
+	  viewbox_height = viewbox.height;
+	}
+      else
+# endif
       if (has_width && has_height)
 	{
 	  /* Success!  We can use these values directly.  */

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-04 21:08             ` David Ponce
@ 2023-08-05  8:30               ` David Ponce
  2023-08-05  9:58                 ` Alan Third
  0 siblings, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-05  8:30 UTC (permalink / raw)
  To: Eli Zaretskii, Alan Third; +Cc: 64908

[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]

On 04/08/2023 23:08, David Ponce wrote:
> On 04/08/2023 21:08, Eli Zaretskii wrote:
>>> Date: Fri, 4 Aug 2023 19:32:13 +0100
>>> From: Alan Third <alan@idiocy.org>
>>> Cc: David Ponce <da_vid@orange.fr>, 64908@debbugs.gnu.org
>>>
>>> On Fri, Aug 04, 2023 at 01:26:45PM +0300, Eli Zaretskii wrote:
>>>>
>>>> Thanks.  I hope this will help an SVG expert to figure out what's
>>>> going on with these images.
>>>>
>>>> Alan, do you have time to look into this, per chance?
>>>
>>> Yeah. I know roughly what needs to be done here thanks to David's most
>>> recent email, but I'll have a wee think about how best to do it since
>>> we already have, I think, three different methods of finding the image
>>> size depending on the version of librsvg. If I can merge a couple of
>>> those approaches it will probably be best.
>>
>> Thanks in advance.
> 
> Eli, Alan,
> 
> Until Alan finds the best solution, the attached simple patch fixed
> the issue for me with librsvg 2.56.3.
> 
> Thanks & Regards

Hello,

I attached a better patch, because it is possible to have svg image
definition that combines viewBox, and percentage of width/height, like
in this example:

(insert-image
   '(image :type svg :data
      "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 22 22\" width=\"110%\" height=\"80%\">
   <defs id=\"defs3051\">
     <style type=\"text/css\" id=\"current-color-scheme\">
       .ColorScheme-Text {
         color:#232629;
       }
       </style>
   </defs>
  <path
     style=\"fill:currentColor;fill-opacity:1;stroke:none\"
     d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
     class=\"ColorScheme-Text\"
     />
</svg>"
     :scale 1))

I hope Alan will find a simpler implementation for all these cases!

Thanks & Regards

[-- Attachment #2: image.c.patch --]
[-- Type: text/x-patch, Size: 1060 bytes --]

diff --git a/src/image.c b/src/image.c
index cb9725892d1..ae24f5b3893 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11358,12 +11358,16 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 
       if (has_width && has_height)
 	{
+	  
 	  /* Success!  We can use these values directly.  */
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
-						    img->face_font_size);
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
-
+	  viewbox_width = ((iwidth.unit == RSVG_UNIT_PERCENT) && has_viewbox)
+	    ? viewbox.width * iwidth.length
+	    : svg_css_length_to_pixels (iwidth, dpi, img->face_font_size);
+	  
+	  viewbox_height = ((iheight.unit == RSVG_UNIT_PERCENT) && has_viewbox)
+	    ? viewbox.height * iheight.length
+	    : svg_css_length_to_pixels (iheight, dpi, img->face_font_size);
+	  
 	  /* Here one dimension could be zero because in percent unit.
 	     So calculate this dimension with the other.  */
 	  if (! (0 < viewbox_width) && (iwidth.unit == RSVG_UNIT_PERCENT))

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05  8:30               ` David Ponce
@ 2023-08-05  9:58                 ` Alan Third
  2023-08-05 10:07                   ` Eli Zaretskii
  2023-08-05 12:32                   ` David Ponce
  0 siblings, 2 replies; 32+ messages in thread
From: Alan Third @ 2023-08-05  9:58 UTC (permalink / raw)
  To: David Ponce; +Cc: Eli Zaretskii, 64908

[-- Attachment #1: Type: text/plain, Size: 2070 bytes --]

On Sat, Aug 05, 2023 at 10:30:38AM +0200, David Ponce wrote:
> Hello,
> 
> I attached a better patch, because it is possible to have svg image
> definition that combines viewBox, and percentage of width/height, like
> in this example:
> 
> (insert-image
>   '(image :type svg :data
>      "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 22 22\" width=\"110%\" height=\"80%\">
>   <defs id=\"defs3051\">
>     <style type=\"text/css\" id=\"current-color-scheme\">
>       .ColorScheme-Text {
>         color:#232629;
>       }
>       </style>
>   </defs>
>  <path
>     style=\"fill:currentColor;fill-opacity:1;stroke:none\"
>     d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
>     class=\"ColorScheme-Text\"
>     />
> </svg>"
>     :scale 1))
> 
> I hope Alan will find a simpler implementation for all these cases!

Hi David, I did a bit of thinking about what a percentage in the width
or height attributes actually means and how librsvg handles it.

I think we should always ignore it.

A percentage is intended as a percentage of the enclosing box. this
means if we set an image width of 100 pixels in Emacs, and the width
in the SVG is 50%, the image should be 50 pixels wide.

However we requested a width of 100 pixels, and Emacs will give us
that no matter what, even scaling it back up.

Additionally, librsvg will scale the drawn image to a width of 50%
anyway.

What this means is if we set the image width to 100 pixels, librsvg
will scale its drawing down by 50% and it should come out the correct
size within the 100 pixel wide image.

I hope that made sense, it took me a bit of thinking about it before I
came to this conclusion. It was really the fact that librsvg scales
its drawing anyway that made me decide there's no point in us also
scaling it.

I've attached a patch, can you give it a go and let me know how it
works.

Or if you disagree with my analysis above, let me know, because I'm
not 100% sure of it.
-- 
Alan Third

[-- Attachment #2: 0001-Fix-percentage-sizes-in-SVG-display-bug-64908.patch --]
[-- Type: text/x-diff, Size: 4292 bytes --]

From 5f300dcfcb25e727ceb2da8c7175cbb331bb0546 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sat, 5 Aug 2023 10:39:31 +0100
Subject: [PATCH] Fix percentage sizes in SVG display (bug#64908)

* src/image.c (svg_css_length_to_pixels): Make percent units always
return zero.
(svg_load_image): Don't rely on the width and height values from the
SVG actually having any useful data, even if they're explicitly set.
---
 src/image.c | 55 +++++++++++++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 23 deletions(-)

diff --git a/src/image.c b/src/image.c
index c9420b48f4a..96e0f2a7225 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11161,6 +11161,21 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
     case RSVG_UNIT_IN:
       value *= dpi;
       break;
+    case RSVG_UNIT_PERCENT:
+      /* Percent is a ratio of the containing "viewport".  We don't
+	 have a viewport, as such, as we try to draw the image to it's
+	 own desired size rather than dictate the size as if we were
+	 drawing icons on a toolbar or similar.  This means that
+	 percent values are useless to us and we are best off just
+	 drawing the image according to whatever other sizes we can
+	 derive.
+
+	 If we do set explicit width and height values in the image
+	 spec, this will work out correctly as librsvg will still
+	 honour the percentage sizes in its final rendering no matter
+	 what size we make the image.  */
+      value = 0;
+      break;
 #if LIBRSVG_CHECK_VERSION (2, 48, 0)
       /* We don't know exactly what font size is used on older librsvg
 	 versions.  */
@@ -11169,7 +11184,7 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
       break;
 #endif
     default:
-      /* Probably ex or %.  We can't know what the pixel value is
+      /* Probably ex.  We can't know what the pixel value is
          without more information.  */
       value = 0;
     }
@@ -11302,6 +11317,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
   else
     {
       RsvgRectangle zero_rect, viewbox, out_logical_rect;
+      double explicit_width = 0, explicit_height = 0;
 
       /* Try the intrinsic dimensions first.  */
       gboolean has_width, has_height;
@@ -11313,34 +11329,27 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 					    &has_height, &iheight,
 					    &has_viewbox, &viewbox);
 
-      if (has_width && has_height)
-	{
-	  /* Success!  We can use these values directly.  */
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
+      if (has_width)
+	explicit_width = svg_css_length_to_pixels (iwidth, dpi,
+						   img->face_font_size);
+      if (has_height)
+	explicit_height = svg_css_length_to_pixels (iheight, dpi,
 						    img->face_font_size);
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
 
-	  /* Here one dimension could be zero because in percent unit.
-	     So calculate this dimension with the other.  */
-	  if (! (0 < viewbox_width) && (iwidth.unit == RSVG_UNIT_PERCENT))
-	    viewbox_width = (viewbox_height * viewbox.width / viewbox.height)
-	      * iwidth.length;
-	  else if (! (0 < viewbox_height) && (iheight.unit == RSVG_UNIT_PERCENT))
-	    viewbox_height = (viewbox_width * viewbox.height / viewbox.width)
-	      * iheight.length;
+      if (explicit_width > 0 && explicit_height > 0)
+	{
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_height;
 	}
-      else if (has_width && has_viewbox)
+      else if (explicit_width > 0 && has_viewbox)
 	{
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
-						    img->face_font_size);
-	  viewbox_height = viewbox_width * viewbox.height / viewbox.width;
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_width * viewbox.height / viewbox.width;
 	}
-      else if (has_height && has_viewbox)
+      else if (explicit_height > 0 && has_viewbox)
 	{
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
-	  viewbox_width = viewbox_height * viewbox.width / viewbox.height;
+	  viewbox_height = explicit_height;
+	  viewbox_width = explicit_height * viewbox.width / viewbox.height;
 	}
       else if (has_viewbox)
 	{
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05  9:58                 ` Alan Third
@ 2023-08-05 10:07                   ` Eli Zaretskii
  2023-08-05 10:24                     ` Alan Third
  2023-08-05 12:32                   ` David Ponce
  1 sibling, 1 reply; 32+ messages in thread
From: Eli Zaretskii @ 2023-08-05 10:07 UTC (permalink / raw)
  To: Alan Third; +Cc: da_vid, 64908

> Date: Sat, 5 Aug 2023 10:58:26 +0100
> From: Alan Third <alan@idiocy.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, 64908@debbugs.gnu.org
> 
> diff --git a/src/image.c b/src/image.c
> index c9420b48f4a..96e0f2a7225 100644
> --- a/src/image.c
> +++ b/src/image.c
> @@ -11161,6 +11161,21 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
>      case RSVG_UNIT_IN:
>        value *= dpi;
>        break;
> +    case RSVG_UNIT_PERCENT:
> +      /* Percent is a ratio of the containing "viewport".  We don't
> +	 have a viewport, as such, as we try to draw the image to it's
> +	 own desired size rather than dictate the size as if we were
> +	 drawing icons on a toolbar or similar.  This means that
> +	 percent values are useless to us and we are best off just
> +	 drawing the image according to whatever other sizes we can
> +	 derive.
> +
> +	 If we do set explicit width and height values in the image
> +	 spec, this will work out correctly as librsvg will still
> +	 honour the percentage sizes in its final rendering no matter
> +	 what size we make the image.  */
> +      value = 0;
> +      break;

I don't see RSVG_UNIT_PERCENT anywhere in the librsvg headers on my
system, so perhaps this was introduced by some later version, and
should be guarded by LIBRSVG_CHECK_VERSION?





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 10:07                   ` Eli Zaretskii
@ 2023-08-05 10:24                     ` Alan Third
  2023-08-05 10:41                       ` Eli Zaretskii
  0 siblings, 1 reply; 32+ messages in thread
From: Alan Third @ 2023-08-05 10:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: da_vid, 64908

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

On Sat, Aug 05, 2023 at 01:07:38PM +0300, Eli Zaretskii wrote:
> > Date: Sat, 5 Aug 2023 10:58:26 +0100
> > From: Alan Third <alan@idiocy.org>
> > Cc: Eli Zaretskii <eliz@gnu.org>, 64908@debbugs.gnu.org
> > 
> > diff --git a/src/image.c b/src/image.c
> > index c9420b48f4a..96e0f2a7225 100644
> > --- a/src/image.c
> > +++ b/src/image.c
> > @@ -11161,6 +11161,21 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
> >      case RSVG_UNIT_IN:
> >        value *= dpi;
> >        break;
> > +    case RSVG_UNIT_PERCENT:
> > +      /* Percent is a ratio of the containing "viewport".  We don't
> > +	 have a viewport, as such, as we try to draw the image to it's
> > +	 own desired size rather than dictate the size as if we were
> > +	 drawing icons on a toolbar or similar.  This means that
> > +	 percent values are useless to us and we are best off just
> > +	 drawing the image according to whatever other sizes we can
> > +	 derive.
> > +
> > +	 If we do set explicit width and height values in the image
> > +	 spec, this will work out correctly as librsvg will still
> > +	 honour the percentage sizes in its final rendering no matter
> > +	 what size we make the image.  */
> > +      value = 0;
> > +      break;
> 
> I don't see RSVG_UNIT_PERCENT anywhere in the librsvg headers on my
> system, so perhaps this was introduced by some later version, and
> should be guarded by LIBRSVG_CHECK_VERSION?

Hmm, I can't find any reference to when it was introduced, so it's
probably easier just to remove it and put the comment in the default
case.

(Interestingly while searching for the version I discovered this code
has been used, almost verbatim, in libvips. The main difference is
they're defining "ex" as half of "em", so perhaps we should copy that
change back over...)
-- 
Alan Third

[-- Attachment #2: v2-0001-Fix-percentage-sizes-in-SVG-display-bug-64908.patch --]
[-- Type: text/x-diff, Size: 4161 bytes --]

From 126ee4b2dffc183e48a47a562a05a142f420ea4d Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sat, 5 Aug 2023 10:39:31 +0100
Subject: [PATCH v2] Fix percentage sizes in SVG display (bug#64908)

* src/image.c (svg_css_length_to_pixels): Make percent units always
return zero.
(svg_load_image): Don't rely on the width and height values from the
SVG actually having any useful data, even if they're explicitly set.
---
 src/image.c | 60 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 24 deletions(-)

diff --git a/src/image.c b/src/image.c
index c9420b48f4a..4e07ea8268d 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11169,8 +11169,26 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
       break;
 #endif
     default:
-      /* Probably ex or %.  We can't know what the pixel value is
-         without more information.  */
+      /* If it's ex then we can't know what the pixel value is without
+         more information.
+
+	 FIXME: perhaps ex should be 1/2 of an em?  I imagine we
+	 should try to match what librsvg does.
+
+	 If it's percent then we don't want to do anything with it.
+
+         Percent is a ratio of the containing "viewport".  We don't
+	 have a viewport, as such, as we try to draw the image to it's
+	 own desired size rather than dictate the size as if we were
+	 drawing icons on a toolbar or similar.  This means that
+	 percent values are useless to us and we are best off just
+	 drawing the image according to whatever other sizes we can
+	 derive.
+
+	 If we do set explicit width and height values in the image
+	 spec, this will work out correctly as librsvg will still
+	 honour the percentage sizes in its final rendering no matter
+	 what size we make the image.  */
       value = 0;
     }
 
@@ -11302,6 +11320,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
   else
     {
       RsvgRectangle zero_rect, viewbox, out_logical_rect;
+      double explicit_width = 0, explicit_height = 0;
 
       /* Try the intrinsic dimensions first.  */
       gboolean has_width, has_height;
@@ -11313,34 +11332,27 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 					    &has_height, &iheight,
 					    &has_viewbox, &viewbox);
 
-      if (has_width && has_height)
-	{
-	  /* Success!  We can use these values directly.  */
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
+      if (has_width)
+	explicit_width = svg_css_length_to_pixels (iwidth, dpi,
+						   img->face_font_size);
+      if (has_height)
+	explicit_height = svg_css_length_to_pixels (iheight, dpi,
 						    img->face_font_size);
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
 
-	  /* Here one dimension could be zero because in percent unit.
-	     So calculate this dimension with the other.  */
-	  if (! (0 < viewbox_width) && (iwidth.unit == RSVG_UNIT_PERCENT))
-	    viewbox_width = (viewbox_height * viewbox.width / viewbox.height)
-	      * iwidth.length;
-	  else if (! (0 < viewbox_height) && (iheight.unit == RSVG_UNIT_PERCENT))
-	    viewbox_height = (viewbox_width * viewbox.height / viewbox.width)
-	      * iheight.length;
+      if (explicit_width > 0 && explicit_height > 0)
+	{
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_height;
 	}
-      else if (has_width && has_viewbox)
+      else if (explicit_width > 0 && has_viewbox)
 	{
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
-						    img->face_font_size);
-	  viewbox_height = viewbox_width * viewbox.height / viewbox.width;
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_width * viewbox.height / viewbox.width;
 	}
-      else if (has_height && has_viewbox)
+      else if (explicit_height > 0 && has_viewbox)
 	{
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
-	  viewbox_width = viewbox_height * viewbox.width / viewbox.height;
+	  viewbox_height = explicit_height;
+	  viewbox_width = explicit_height * viewbox.width / viewbox.height;
 	}
       else if (has_viewbox)
 	{
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 10:24                     ` Alan Third
@ 2023-08-05 10:41                       ` Eli Zaretskii
  0 siblings, 0 replies; 32+ messages in thread
From: Eli Zaretskii @ 2023-08-05 10:41 UTC (permalink / raw)
  To: Alan Third; +Cc: da_vid, 64908

> Date: Sat, 5 Aug 2023 11:24:19 +0100
> From: Alan Third <alan@idiocy.org>
> Cc: da_vid@orange.fr, 64908@debbugs.gnu.org
> 
> On Sat, Aug 05, 2023 at 01:07:38PM +0300, Eli Zaretskii wrote:
> > > Date: Sat, 5 Aug 2023 10:58:26 +0100
> > > From: Alan Third <alan@idiocy.org>
> > > Cc: Eli Zaretskii <eliz@gnu.org>, 64908@debbugs.gnu.org
> > > 
> > > diff --git a/src/image.c b/src/image.c
> > > index c9420b48f4a..96e0f2a7225 100644
> > > --- a/src/image.c
> > > +++ b/src/image.c
> > > @@ -11161,6 +11161,21 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
> > >      case RSVG_UNIT_IN:
> > >        value *= dpi;
> > >        break;
> > > +    case RSVG_UNIT_PERCENT:
> > > +      /* Percent is a ratio of the containing "viewport".  We don't
> > > +	 have a viewport, as such, as we try to draw the image to it's
> > > +	 own desired size rather than dictate the size as if we were
> > > +	 drawing icons on a toolbar or similar.  This means that
> > > +	 percent values are useless to us and we are best off just
> > > +	 drawing the image according to whatever other sizes we can
> > > +	 derive.
> > > +
> > > +	 If we do set explicit width and height values in the image
> > > +	 spec, this will work out correctly as librsvg will still
> > > +	 honour the percentage sizes in its final rendering no matter
> > > +	 what size we make the image.  */
> > > +      value = 0;
> > > +      break;
> > 
> > I don't see RSVG_UNIT_PERCENT anywhere in the librsvg headers on my
> > system, so perhaps this was introduced by some later version, and
> > should be guarded by LIBRSVG_CHECK_VERSION?
> 
> Hmm, I can't find any reference to when it was introduced, so it's
> probably easier just to remove it and put the comment in the default
> case.

My guess is it was introduced in v2.46, as the entire code of
svg_css_length_to_pixels is guarded by that version.  So I think using
RSVG_UNIT_PERCENT in that function is fine.





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05  9:58                 ` Alan Third
  2023-08-05 10:07                   ` Eli Zaretskii
@ 2023-08-05 12:32                   ` David Ponce
  2023-08-05 15:14                     ` Alan Third
  1 sibling, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-05 12:32 UTC (permalink / raw)
  To: Alan Third, Eli Zaretskii, 64908

On 05/08/2023 11:58, Alan Third wrote:
> Hi David, I did a bit of thinking about what a percentage in the width
> or height attributes actually means and how librsvg handles it.
> 
> I think we should always ignore it.
> 
> A percentage is intended as a percentage of the enclosing box. this
> means if we set an image width of 100 pixels in Emacs, and the width
> in the SVG is 50%, the image should be 50 pixels wide.
> 
> However we requested a width of 100 pixels, and Emacs will give us
> that no matter what, even scaling it back up.
> 
> Additionally, librsvg will scale the drawn image to a width of 50%
> anyway.
> 
> What this means is if we set the image width to 100 pixels, librsvg
> will scale its drawing down by 50% and it should come out the correct
> size within the 100 pixel wide image.
> 
> I hope that made sense, it took me a bit of thinking about it before I
> came to this conclusion. It was really the fact that librsvg scales
> its drawing anyway that made me decide there's no point in us also
> scaling it.
> 
> I've attached a patch, can you give it a go and let me know how it
> works.
> 
> Or if you disagree with my analysis above, let me know, because I'm
> not 100% sure of it.

Hi Alan,

I did test your V2 patch, and it seems to work well.
I tend to agree with your reasoning, even if I am not enough a
librsvg expert to fully understand all the details.

One case however is not working, when the svg image just specify
percentage for width and height without a viewbox, like this:

'(image :type svg :data
      "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
   <defs id=\"defs3051\">
     <style type=\"text/css\" id=\"current-color-scheme\">
       .ColorScheme-Text {
         color:#232629;
       }
       </style>
   </defs>
  <path
     style=\"fill:currentColor;fill-opacity:1;stroke:none\"
     d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
     class=\"ColorScheme-Text\"
     />
</svg>"
      :scale 1)

I can display a such image in firefox, gwenview, or inkscape, but not in Emacs.
I guess it works in applications that provide a default viewbox when not defined.
And it is failing in Emacs because no default viewbox is provided.

What could be questionable is if it makes sense to fail when image also specifies
:width and :height, like this:

'(image :type svg :data
      "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
   <defs id=\"defs3051\">
     <style type=\"text/css\" id=\"current-color-scheme\">
       .ColorScheme-Text {
         color:#232629;
       }
       </style>
   </defs>
  <path
     style=\"fill:currentColor;fill-opacity:1;stroke:none\"
     d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
     class=\"ColorScheme-Text\"
     />
</svg>"
      :scale 1 :width 22 :height 22)

I wonder if it could make sense to provide a default viewbox having image :width and :height?
Not sure it will be useful, though.

Thanks

    





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 12:32                   ` David Ponce
@ 2023-08-05 15:14                     ` Alan Third
  2023-08-05 15:53                       ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: Alan Third @ 2023-08-05 15:14 UTC (permalink / raw)
  To: David Ponce; +Cc: Eli Zaretskii, 64908

On Sat, Aug 05, 2023 at 02:32:07PM +0200, David Ponce wrote:
> On 05/08/2023 11:58, Alan Third wrote:
> I did test your V2 patch, and it seems to work well.
> I tend to agree with your reasoning, even if I am not enough a
> librsvg expert to fully understand all the details.

Thanks!

> One case however is not working, when the svg image just specify
> percentage for width and height without a viewbox, like this:
> 
> '(image :type svg :data
>      "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
>   <defs id=\"defs3051\">
>     <style type=\"text/css\" id=\"current-color-scheme\">
>       .ColorScheme-Text {
>         color:#232629;
>       }
>       </style>
>   </defs>
>  <path
>     style=\"fill:currentColor;fill-opacity:1;stroke:none\"
>     d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
>     class=\"ColorScheme-Text\"
>     />
> </svg>"
>      :scale 1)
> 
> I can display a such image in firefox, gwenview, or inkscape, but not in Emacs.
> I guess it works in applications that provide a default viewbox when not defined.
> And it is failing in Emacs because no default viewbox is provided.

Very strange, it works here. rsvg_handle_get_geometry_for_layer should
handle this fine. I wonder if something subtle has changed with
2.56... I can't fine anything in the documentation to say this has
changed...

We can always provide an absolute fallback of 100x100 or something. I
think that's what we used to do. But it would be good to know if
something is actually broken here. Are you able to check the return
value of rsvg_handle_get_geometry_for_layer and see if it's throwing
up an error?
-- 
Alan Third





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 15:14                     ` Alan Third
@ 2023-08-05 15:53                       ` David Ponce
  2023-08-05 16:02                         ` Alan Third
  0 siblings, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-05 15:53 UTC (permalink / raw)
  To: Alan Third, Eli Zaretskii, 64908

On 05/08/2023 17:14, Alan Third wrote:
> On Sat, Aug 05, 2023 at 02:32:07PM +0200, David Ponce wrote:
>> On 05/08/2023 11:58, Alan Third wrote:
>> I did test your V2 patch, and it seems to work well.
>> I tend to agree with your reasoning, even if I am not enough a
>> librsvg expert to fully understand all the details.
> 
> Thanks!
> 
>> One case however is not working, when the svg image just specify
>> percentage for width and height without a viewbox, like this:
>>
>> '(image :type svg :data
>>       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
>>    <defs id=\"defs3051\">
>>      <style type=\"text/css\" id=\"current-color-scheme\">
>>        .ColorScheme-Text {
>>          color:#232629;
>>        }
>>        </style>
>>    </defs>
>>   <path
>>      style=\"fill:currentColor;fill-opacity:1;stroke:none\"
>>      d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
>>      class=\"ColorScheme-Text\"
>>      />
>> </svg>"
>>       :scale 1)
>>
>> I can display a such image in firefox, gwenview, or inkscape, but not in Emacs.
>> I guess it works in applications that provide a default viewbox when not defined.
>> And it is failing in Emacs because no default viewbox is provided.
> 
> Very strange, it works here. rsvg_handle_get_geometry_for_layer should
> handle this fine. I wonder if something subtle has changed with
> 2.56... I can't fine anything in the documentation to say this has
> changed...
> 
> We can always provide an absolute fallback of 100x100 or something. I
> think that's what we used to do. But it would be good to know if
> something is actually broken here. Are you able to check the return
> value of rsvg_handle_get_geometry_for_layer and see if it's throwing
> up an error?

Using this image spec:

'(image :type svg :data
      "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
   <defs id=\"defs3051\">
     <style type=\"text/css\" id=\"current-color-scheme\">
       .ColorScheme-Text {
         color:#232629;
       }
       </style>
   </defs>
  <path
     style=\"fill:currentColor;fill-opacity:1;stroke:none\"
     d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
     class=\"ColorScheme-Text\"
     />
</svg>"
      :scale 1 :width 22 :height 22)

rsvg_handle_get_geometry_for_layer returns 1, and insert-image displays
a black square of 22x22 pixels.







^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 15:53                       ` David Ponce
@ 2023-08-05 16:02                         ` Alan Third
  2023-08-05 16:24                           ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: Alan Third @ 2023-08-05 16:02 UTC (permalink / raw)
  To: David Ponce; +Cc: Eli Zaretskii, 64908

On Sat, Aug 05, 2023 at 05:53:52PM +0200, David Ponce wrote:
> On 05/08/2023 17:14, Alan Third wrote:
> > On Sat, Aug 05, 2023 at 02:32:07PM +0200, David Ponce wrote:
> > > On 05/08/2023 11:58, Alan Third wrote:
> > > I did test your V2 patch, and it seems to work well.
> > > I tend to agree with your reasoning, even if I am not enough a
> > > librsvg expert to fully understand all the details.
> > 
> > Thanks!
> > 
> > > One case however is not working, when the svg image just specify
> > > percentage for width and height without a viewbox, like this:
> > > 
> > > '(image :type svg :data
> > >       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
> > >    <defs id=\"defs3051\">
> > >      <style type=\"text/css\" id=\"current-color-scheme\">
> > >        .ColorScheme-Text {
> > >          color:#232629;
> > >        }
> > >        </style>
> > >    </defs>
> > >   <path
> > >      style=\"fill:currentColor;fill-opacity:1;stroke:none\"
> > >      d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
> > >      class=\"ColorScheme-Text\"
> > >      />
> > > </svg>"
> > >       :scale 1)
> > > 
> > > I can display a such image in firefox, gwenview, or inkscape, but not in Emacs.
> > > I guess it works in applications that provide a default viewbox when not defined.
> > > And it is failing in Emacs because no default viewbox is provided.
> > 
> > Very strange, it works here. rsvg_handle_get_geometry_for_layer should
> > handle this fine. I wonder if something subtle has changed with
> > 2.56... I can't fine anything in the documentation to say this has
> > changed...
> > 
> > We can always provide an absolute fallback of 100x100 or something. I
> > think that's what we used to do. But it would be good to know if
> > something is actually broken here. Are you able to check the return
> > value of rsvg_handle_get_geometry_for_layer and see if it's throwing
> > up an error?
> 
> Using this image spec:
> 
> '(image :type svg :data
>      "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
>   <defs id=\"defs3051\">
>     <style type=\"text/css\" id=\"current-color-scheme\">
>       .ColorScheme-Text {
>         color:#232629;
>       }
>       </style>
>   </defs>
>  <path
>     style=\"fill:currentColor;fill-opacity:1;stroke:none\"
>     d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
>     class=\"ColorScheme-Text\"
>     />
> </svg>"
>      :scale 1 :width 22 :height 22)
> 
> rsvg_handle_get_geometry_for_layer returns 1, and insert-image displays
> a black square of 22x22 pixels.

Is your Emacs background black?

It sounds like rsvg_handle_get_geometry_for_layer is working, but
something else is going wrong...

If you're able to use a debugger (I think you already did earlier in
this thread) can you check the values of zero_rect, viewbox and
out_logical_rect after rsvg_handle_get_geometry_for_layer has run?

-- 
Alan Third





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 16:02                         ` Alan Third
@ 2023-08-05 16:24                           ` David Ponce
  2023-08-05 16:31                             ` Alan Third
  0 siblings, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-05 16:24 UTC (permalink / raw)
  To: Alan Third, Eli Zaretskii, 64908

[-- Attachment #1: Type: text/plain, Size: 2792 bytes --]

On 05/08/2023 18:02, Alan Third wrote:
[...]
> Is your Emacs background black?
> 
> It sounds like rsvg_handle_get_geometry_for_layer is working, but
> something else is going wrong...
> 
> If you're able to use a debugger (I think you already did earlier in
> this thread) can you check the values of zero_rect, viewbox and
> out_logical_rect after rsvg_handle_get_geometry_for_layer has run?
> 

I am running "emacs -Q" configured with below options:

In GNU Emacs 30.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version
  3.24.38, cairo version 1.17.8) of 2023-08-05 built on kilauea
Repository revision: 9026990c6685e87c328f4fcc575ef644c2f5595a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 38 (KDE Plasma)

Configured using:
  'configure --prefix=/home/dponce --with-x-toolkit=gtk3
  --with-native-compilation=no
  PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Background is white by default.

In *scratch* buffer I eval:

(insert-image '(image :type svg :data
      "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
   <defs id=\"defs3051\">
     <style type=\"text/css\" id=\"current-color-scheme\">
       .ColorScheme-Text {
         color:#232629;
       }
       </style>
   </defs>
  <path
     style=\"fill:currentColor;fill-opacity:1;stroke:none\"
     d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
     class=\"ColorScheme-Text\"
     />
</svg>"
      :scale 1 :width 22 :height 22))

Just before call rsvg_handle_get_geometry_for_layer (line 11412 in image.c):

(gdb) print zero_rect
$1 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
(gdb) print viewbox
$2 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}
(gdb) print out_logical_rect
$3 = {x = 1.2476920383715837e-316, y = 0, width = 0, height = 3.3675983782902914e-317}

Just after:

(gdb) print zero_rect
$4 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
(gdb) print viewbox
$5 = {x = 0, y = 0, width = 0, height = 0}
(gdb) print out_logical_rect
$6 = {x = 0, y = 0, width = 0, height = 0}
(gdb) print $eax
$7 = 1

I attached a screenshot of the result.

[-- Attachment #2: Screenshot_20230805_182116.png --]
[-- Type: image/png, Size: 79890 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 16:24                           ` David Ponce
@ 2023-08-05 16:31                             ` Alan Third
  2023-08-05 17:37                               ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: Alan Third @ 2023-08-05 16:31 UTC (permalink / raw)
  To: David Ponce; +Cc: Eli Zaretskii, 64908

[-- Attachment #1: Type: text/plain, Size: 1216 bytes --]

On Sat, Aug 05, 2023 at 06:24:43PM +0200, David Ponce wrote:
> 
> Background is white by default.

Thanks.

> Just before call rsvg_handle_get_geometry_for_layer (line 11412 in image.c):
> 
> (gdb) print zero_rect
> $1 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
> (gdb) print viewbox
> $2 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}
> (gdb) print out_logical_rect
> $3 = {x = 1.2476920383715837e-316, y = 0, width = 0, height = 3.3675983782902914e-317}
> 
> Just after:
> 
> (gdb) print zero_rect
> $4 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
> (gdb) print viewbox
> $5 = {x = 0, y = 0, width = 0, height = 0}
> (gdb) print out_logical_rect
> $6 = {x = 0, y = 0, width = 0, height = 0}
> (gdb) print $eax
> $7 = 1

Yeah, I see what's going on.

I was under the impression a new struct should always be set to all
zeroes, but evidently not.

Are you getting any build warnings about it being uninitialised?

Anyway, 3rd go at the patch attached.
-- 
Alan Third

[-- Attachment #2: v3-0001-Fix-percentage-sizes-in-SVG-display-bug-64908.patch --]
[-- Type: text/x-diff, Size: 4901 bytes --]

From 73c7cde4c2df9e130cfa51593963458da046d7dd Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sat, 5 Aug 2023 10:39:31 +0100
Subject: [PATCH v3] Fix percentage sizes in SVG display (bug#64908)

* src/image.c (svg_css_length_to_pixels): Make percent units always
return zero and handle font size based units better.
(svg_load_image): Don't rely on the width and height values from the
SVG actually having any useful data, even if they're explicitly set.
---
 src/image.c | 74 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 45 insertions(+), 29 deletions(-)

diff --git a/src/image.c b/src/image.c
index c9420b48f4a..cb14cefaf89 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11137,6 +11137,12 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
 {
   double value = length.length;
 
+#if ! LIBRSVG_CHECK_VERSION (2, 48, 0)
+  /* librsvg 2.48 lets us define the font size, but earlier versions
+     default to 12 pixels.  */
+  font_size = 12;
+#endif
+
   switch (length.unit)
     {
     case RSVG_UNIT_PX:
@@ -11161,16 +11167,31 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
     case RSVG_UNIT_IN:
       value *= dpi;
       break;
-#if LIBRSVG_CHECK_VERSION (2, 48, 0)
-      /* We don't know exactly what font size is used on older librsvg
-	 versions.  */
     case RSVG_UNIT_EM:
       value *= font_size;
       break;
-#endif
+    case RSVG_UNIT_EX:
+      /* librsvg uses an ex height of half the em height, so we match
+	 that here.  */
+      value = value * font_size / 2.0;
+      break;
+    case RSVG_UNIT_PERCENT:
+      /* Percent is a ratio of the containing "viewport".  We don't
+	 have a viewport, as such, as we try to draw the image to it's
+	 'natural' size rather than dictate the size as if we were
+	 drawing icons on a toolbar or similar.  This means that
+	 percent values are useless to us and we are best off just
+	 drawing the image according to whatever other sizes we can
+	 derive.
+
+	 If we do set explicit width and height values in the image
+	 spec, this will work out correctly as librsvg will still
+	 honour the percentage sizes in its final rendering no matter
+	 what size we make the image.  */
+      value = 0;
+      break;
     default:
-      /* Probably ex or %.  We can't know what the pixel value is
-         without more information.  */
+      /* We should never reach this.  */
       value = 0;
     }
 
@@ -11301,7 +11322,9 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
     }
   else
     {
-      RsvgRectangle zero_rect, viewbox, out_logical_rect;
+      RsvgRectangle viewbox, out_logical_rect;
+      RsvgRectangle zero_rect = {0, 0, 0, 0};
+      double explicit_width = 0, explicit_height = 0;
 
       /* Try the intrinsic dimensions first.  */
       gboolean has_width, has_height;
@@ -11313,34 +11336,27 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 					    &has_height, &iheight,
 					    &has_viewbox, &viewbox);
 
-      if (has_width && has_height)
-	{
-	  /* Success!  We can use these values directly.  */
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
+      if (has_width)
+	explicit_width = svg_css_length_to_pixels (iwidth, dpi,
+						   img->face_font_size);
+      if (has_height)
+	explicit_height = svg_css_length_to_pixels (iheight, dpi,
 						    img->face_font_size);
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
 
-	  /* Here one dimension could be zero because in percent unit.
-	     So calculate this dimension with the other.  */
-	  if (! (0 < viewbox_width) && (iwidth.unit == RSVG_UNIT_PERCENT))
-	    viewbox_width = (viewbox_height * viewbox.width / viewbox.height)
-	      * iwidth.length;
-	  else if (! (0 < viewbox_height) && (iheight.unit == RSVG_UNIT_PERCENT))
-	    viewbox_height = (viewbox_width * viewbox.height / viewbox.width)
-	      * iheight.length;
+      if (explicit_width > 0 && explicit_height > 0)
+	{
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_height;
 	}
-      else if (has_width && has_viewbox)
+      else if (explicit_width > 0 && has_viewbox)
 	{
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
-						    img->face_font_size);
-	  viewbox_height = viewbox_width * viewbox.height / viewbox.width;
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_width * viewbox.height / viewbox.width;
 	}
-      else if (has_height && has_viewbox)
+      else if (explicit_height > 0 && has_viewbox)
 	{
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
-	  viewbox_width = viewbox_height * viewbox.width / viewbox.height;
+	  viewbox_height = explicit_height;
+	  viewbox_width = explicit_height * viewbox.width / viewbox.height;
 	}
       else if (has_viewbox)
 	{
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 16:31                             ` Alan Third
@ 2023-08-05 17:37                               ` David Ponce
  2023-08-05 17:39                                 ` Alan Third
  0 siblings, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-05 17:37 UTC (permalink / raw)
  To: Alan Third, Eli Zaretskii, 64908

On 05/08/2023 18:31, Alan Third wrote:
> On Sat, Aug 05, 2023 at 06:24:43PM +0200, David Ponce wrote:
>>
>> Background is white by default.
> 
> Thanks.
> 
>> Just before call rsvg_handle_get_geometry_for_layer (line 11412 in image.c):
>>
>> (gdb) print zero_rect
>> $1 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
>> (gdb) print viewbox
>> $2 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}
>> (gdb) print out_logical_rect
>> $3 = {x = 1.2476920383715837e-316, y = 0, width = 0, height = 3.3675983782902914e-317}
>>
>> Just after:
>>
>> (gdb) print zero_rect
>> $4 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
>> (gdb) print viewbox
>> $5 = {x = 0, y = 0, width = 0, height = 0}
>> (gdb) print out_logical_rect
>> $6 = {x = 0, y = 0, width = 0, height = 0}
>> (gdb) print $eax
>> $7 = 1
> 
> Yeah, I see what's going on.
> 
> I was under the impression a new struct should always be set to all
> zeroes, but evidently not.
> 
> Are you getting any build warnings about it being uninitialised?
> 
> Anyway, 3rd go at the patch attached.

Thanks

I just tried patch V3, and the result is the same:
insert-image produces the same black square of 22x22 pixels.

Before call to rsvg_handle_get_geometry_for_layer:

(gdb) print zero_rect
$1 = {x = 0, y = 0, width = 0, height = 0}
(gdb)  print viewbox
$2 = {x = 6.9533474147268633e-310, y = 2.4821858047064226e-320, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
(gdb)  print out_logical_rect
$3 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}

after call to rsvg_handle_get_geometry_for_layer:

(gdb) print $eax
$4 = 1
(gdb) print zero_rect
$5 = {x = 0, y = 0, width = 0, height = 0}
(gdb)  print viewbox
$6 = {x = 0, y = 0, width = 0, height = 0}
(gdb)  print out_logical_rect
$7 = {x = 0, y = 0, width = 0, height = 0}







^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 17:37                               ` David Ponce
@ 2023-08-05 17:39                                 ` Alan Third
  2023-08-05 18:00                                   ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: Alan Third @ 2023-08-05 17:39 UTC (permalink / raw)
  To: David Ponce; +Cc: Eli Zaretskii, 64908

On Sat, Aug 05, 2023 at 07:37:01PM +0200, David Ponce wrote:
> On 05/08/2023 18:31, Alan Third wrote:
> > On Sat, Aug 05, 2023 at 06:24:43PM +0200, David Ponce wrote:
> > > 
> > > Background is white by default.
> > 
> > Thanks.
> > 
> > > Just before call rsvg_handle_get_geometry_for_layer (line 11412 in image.c):
> > > 
> > > (gdb) print zero_rect
> > > $1 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
> > > (gdb) print viewbox
> > > $2 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}
> > > (gdb) print out_logical_rect
> > > $3 = {x = 1.2476920383715837e-316, y = 0, width = 0, height = 3.3675983782902914e-317}
> > > 
> > > Just after:
> > > 
> > > (gdb) print zero_rect
> > > $4 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
> > > (gdb) print viewbox
> > > $5 = {x = 0, y = 0, width = 0, height = 0}
> > > (gdb) print out_logical_rect
> > > $6 = {x = 0, y = 0, width = 0, height = 0}
> > > (gdb) print $eax
> > > $7 = 1
> > 
> > Yeah, I see what's going on.
> > 
> > I was under the impression a new struct should always be set to all
> > zeroes, but evidently not.
> > 
> > Are you getting any build warnings about it being uninitialised?
> > 
> > Anyway, 3rd go at the patch attached.
> 
> Thanks
> 
> I just tried patch V3, and the result is the same:
> insert-image produces the same black square of 22x22 pixels.

Can you try changing the initialisation of zero_rect to {0, 0, 10,
10}?

I remember a lot of trial and error with this originally, and it looks
like they may have changed how it works.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 17:39                                 ` Alan Third
@ 2023-08-05 18:00                                   ` David Ponce
  2023-08-05 18:31                                     ` Alan Third
  0 siblings, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-05 18:00 UTC (permalink / raw)
  To: Alan Third, Eli Zaretskii, 64908

[-- Attachment #1: Type: text/plain, Size: 2570 bytes --]

On 05/08/2023 19:39, Alan Third wrote:
> On Sat, Aug 05, 2023 at 07:37:01PM +0200, David Ponce wrote:
>> On 05/08/2023 18:31, Alan Third wrote:
>>> On Sat, Aug 05, 2023 at 06:24:43PM +0200, David Ponce wrote:
>>>>
>>>> Background is white by default.
>>>
>>> Thanks.
>>>
>>>> Just before call rsvg_handle_get_geometry_for_layer (line 11412 in image.c):
>>>>
>>>> (gdb) print zero_rect
>>>> $1 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
>>>> (gdb) print viewbox
>>>> $2 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}
>>>> (gdb) print out_logical_rect
>>>> $3 = {x = 1.2476920383715837e-316, y = 0, width = 0, height = 3.3675983782902914e-317}
>>>>
>>>> Just after:
>>>>
>>>> (gdb) print zero_rect
>>>> $4 = {x = 6.9533474147268633e-310, y = 2.4608421688060808e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
>>>> (gdb) print viewbox
>>>> $5 = {x = 0, y = 0, width = 0, height = 0}
>>>> (gdb) print out_logical_rect
>>>> $6 = {x = 0, y = 0, width = 0, height = 0}
>>>> (gdb) print $eax
>>>> $7 = 1
>>>
>>> Yeah, I see what's going on.
>>>
>>> I was under the impression a new struct should always be set to all
>>> zeroes, but evidently not.
>>>
>>> Are you getting any build warnings about it being uninitialised?
>>>
>>> Anyway, 3rd go at the patch attached.
>>
>> Thanks
>>
>> I just tried patch V3, and the result is the same:
>> insert-image produces the same black square of 22x22 pixels.
> 
> Can you try changing the initialisation of zero_rect to {0, 0, 10,
> 10}?
> 
> I remember a lot of trial and error with this originally, and it looks
> like they may have changed how it works.

It is better :-)

Before call to rsvg_handle_get_geometry_for_layer:

(gdb) print zero_rect
$1 = {x = 0, y = 0, width = 10, height = 10}
(gdb) print viewbox
$2 = {x = 6.9533474147268633e-310, y = 2.3106462124703418e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
(gdb) print out_logical_rect
$3 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}

After call:

(gdb) print $eax
$4 = 1
(gdb) print zero_rect
$5 = {x = 0, y = 0, width = 10, height = 10}
(gdb) print viewbox
$6 = {x = 7, y = 3, width = 8.70703125, height = 16}
(gdb) print out_logical_rect
$7 = {x = 7, y = 3, width = 8.70703125, height = 16}

Now I see the image, aligned at bottom right on the line (see the screenshot).

[-- Attachment #2: Screenshot_20230805_195631.png --]
[-- Type: image/png, Size: 80314 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 18:00                                   ` David Ponce
@ 2023-08-05 18:31                                     ` Alan Third
  2023-08-05 20:04                                       ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: Alan Third @ 2023-08-05 18:31 UTC (permalink / raw)
  To: David Ponce; +Cc: Eli Zaretskii, 64908

[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]

On Sat, Aug 05, 2023 at 08:00:17PM +0200, David Ponce wrote:
> On 05/08/2023 19:39, Alan Third wrote:
> > On Sat, Aug 05, 2023 at 07:37:01PM +0200, David Ponce wrote:
> > > 
> > > I just tried patch V3, and the result is the same:
> > > insert-image produces the same black square of 22x22 pixels.
> > 
> > Can you try changing the initialisation of zero_rect to {0, 0, 10,
> > 10}?
> > 
> > I remember a lot of trial and error with this originally, and it looks
> > like they may have changed how it works.
> 
> It is better :-)
> 
> Before call to rsvg_handle_get_geometry_for_layer:
> 
> (gdb) print zero_rect
> $1 = {x = 0, y = 0, width = 10, height = 10}
> (gdb) print viewbox
> $2 = {x = 6.9533474147268633e-310, y = 2.3106462124703418e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
> (gdb) print out_logical_rect
> $3 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}
> 
> After call:
> 
> (gdb) print $eax
> $4 = 1
> (gdb) print zero_rect
> $5 = {x = 0, y = 0, width = 10, height = 10}
> (gdb) print viewbox
> $6 = {x = 7, y = 3, width = 8.70703125, height = 16}
> (gdb) print out_logical_rect
> $7 = {x = 7, y = 3, width = 8.70703125, height = 16}
> 
> Now I see the image, aligned at bottom right on the line (see the screenshot).

OK. I really don't understand how this works, and I'm sure some older
version of librsvg required a viewport of zero size, but I don't know
which, so this is all a bit of a stab in the dark. Anyway, patch
attached with a viewport that is hopefully big enough for all the SVGs
we'll ever see. :)

-- 
Alan Third

[-- Attachment #2: v4-0001-Fix-percentage-sizes-in-SVG-display-bug-64908.patch --]
[-- Type: text/x-diff, Size: 5541 bytes --]

From b37126c0c72b6949783a3044b44896e0ebbd9606 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sat, 5 Aug 2023 10:39:31 +0100
Subject: [PATCH v4] Fix percentage sizes in SVG display (bug#64908)

* src/image.c (svg_css_length_to_pixels): Make percent units always
return zero and handle font size based units better.
(svg_load_image): Don't rely on the width and height values from the
SVG actually having any useful data, even if they're explicitly set.
---
 src/image.c | 82 +++++++++++++++++++++++++++++++++--------------------
 1 file changed, 52 insertions(+), 30 deletions(-)

diff --git a/src/image.c b/src/image.c
index c9420b48f4a..bc42f3c55f9 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11137,6 +11137,12 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
 {
   double value = length.length;
 
+#if ! LIBRSVG_CHECK_VERSION (2, 48, 0)
+  /* librsvg 2.48 lets us define the font size, but earlier versions
+     default to 12 pixels.  */
+  font_size = 12;
+#endif
+
   switch (length.unit)
     {
     case RSVG_UNIT_PX:
@@ -11161,16 +11167,31 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
     case RSVG_UNIT_IN:
       value *= dpi;
       break;
-#if LIBRSVG_CHECK_VERSION (2, 48, 0)
-      /* We don't know exactly what font size is used on older librsvg
-	 versions.  */
     case RSVG_UNIT_EM:
       value *= font_size;
       break;
-#endif
+    case RSVG_UNIT_EX:
+      /* librsvg uses an ex height of half the em height, so we match
+	 that here.  */
+      value = value * font_size / 2.0;
+      break;
+    case RSVG_UNIT_PERCENT:
+      /* Percent is a ratio of the containing "viewport".  We don't
+	 have a viewport, as such, as we try to draw the image to it's
+	 'natural' size rather than dictate the size as if we were
+	 drawing icons on a toolbar or similar.  This means that
+	 percent values are useless to us and we are best off just
+	 drawing the image according to whatever other sizes we can
+	 derive.
+
+	 If we do set explicit width and height values in the image
+	 spec, this will work out correctly as librsvg will still
+	 honour the percentage sizes in its final rendering no matter
+	 what size we make the image.  */
+      value = 0;
+      break;
     default:
-      /* Probably ex or %.  We can't know what the pixel value is
-         without more information.  */
+      /* We should never reach this.  */
       value = 0;
     }
 
@@ -11301,7 +11322,8 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
     }
   else
     {
-      RsvgRectangle zero_rect, viewbox, out_logical_rect;
+      RsvgRectangle  viewbox;
+      double explicit_width = 0, explicit_height = 0;
 
       /* Try the intrinsic dimensions first.  */
       gboolean has_width, has_height;
@@ -11313,34 +11335,27 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 					    &has_height, &iheight,
 					    &has_viewbox, &viewbox);
 
-      if (has_width && has_height)
-	{
-	  /* Success!  We can use these values directly.  */
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
+      if (has_width)
+	explicit_width = svg_css_length_to_pixels (iwidth, dpi,
+						   img->face_font_size);
+      if (has_height)
+	explicit_height = svg_css_length_to_pixels (iheight, dpi,
 						    img->face_font_size);
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
 
-	  /* Here one dimension could be zero because in percent unit.
-	     So calculate this dimension with the other.  */
-	  if (! (0 < viewbox_width) && (iwidth.unit == RSVG_UNIT_PERCENT))
-	    viewbox_width = (viewbox_height * viewbox.width / viewbox.height)
-	      * iwidth.length;
-	  else if (! (0 < viewbox_height) && (iheight.unit == RSVG_UNIT_PERCENT))
-	    viewbox_height = (viewbox_width * viewbox.height / viewbox.width)
-	      * iheight.length;
+      if (explicit_width > 0 && explicit_height > 0)
+	{
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_height;
 	}
-      else if (has_width && has_viewbox)
+      else if (explicit_width > 0 && has_viewbox)
 	{
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
-						    img->face_font_size);
-	  viewbox_height = viewbox_width * viewbox.height / viewbox.width;
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_width * viewbox.height / viewbox.width;
 	}
-      else if (has_height && has_viewbox)
+      else if (explicit_height > 0 && has_viewbox)
 	{
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
-	  viewbox_width = viewbox_height * viewbox.width / viewbox.height;
+	  viewbox_height = explicit_height;
+	  viewbox_width = explicit_height * viewbox.width / viewbox.height;
 	}
       else if (has_viewbox)
 	{
@@ -11354,8 +11369,15 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 	{
 	  /* We haven't found a usable set of sizes, so try working out
 	     the visible area.  */
+
+	  /* FIXME: I'm not sure exactly how librsvg uses this
+	     viewport input here, so I'm not sure what values I should
+	     set. */
+	  RsvgRectangle max_viewport_rect = {0, 0, UINT_MAX, UINT_MAX};
+	  RsvgRectangle out_logical_rect;
+
 	  rsvg_handle_get_geometry_for_layer (rsvg_handle, NULL,
-					      &zero_rect, &viewbox,
+					      &max_viewport_rect, &viewbox,
 					      &out_logical_rect, NULL);
 	  viewbox_width = viewbox.x + viewbox.width;
 	  viewbox_height = viewbox.y + viewbox.height;
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 18:31                                     ` Alan Third
@ 2023-08-05 20:04                                       ` David Ponce
  2023-08-08 13:58                                         ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-05 20:04 UTC (permalink / raw)
  To: Alan Third, Eli Zaretskii, 64908

On 05/08/2023 20:31, Alan Third wrote:
> On Sat, Aug 05, 2023 at 08:00:17PM +0200, David Ponce wrote:
>> On 05/08/2023 19:39, Alan Third wrote:
>>> On Sat, Aug 05, 2023 at 07:37:01PM +0200, David Ponce wrote:
>>>>
>>>> I just tried patch V3, and the result is the same:
>>>> insert-image produces the same black square of 22x22 pixels.
>>>
>>> Can you try changing the initialisation of zero_rect to {0, 0, 10,
>>> 10}?
>>>
>>> I remember a lot of trial and error with this originally, and it looks
>>> like they may have changed how it works.
>>
>> It is better :-)
>>
>> Before call to rsvg_handle_get_geometry_for_layer:
>>
>> (gdb) print zero_rect
>> $1 = {x = 0, y = 0, width = 10, height = 10}
>> (gdb) print viewbox
>> $2 = {x = 6.9533474147268633e-310, y = 2.3106462124703418e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
>> (gdb) print out_logical_rect
>> $3 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}
>>
>> After call:
>>
>> (gdb) print $eax
>> $4 = 1
>> (gdb) print zero_rect
>> $5 = {x = 0, y = 0, width = 10, height = 10}
>> (gdb) print viewbox
>> $6 = {x = 7, y = 3, width = 8.70703125, height = 16}
>> (gdb) print out_logical_rect
>> $7 = {x = 7, y = 3, width = 8.70703125, height = 16}
>>
>> Now I see the image, aligned at bottom right on the line (see the screenshot).
> 
> OK. I really don't understand how this works, and I'm sure some older
> version of librsvg required a viewport of zero size, but I don't know
> which, so this is all a bit of a stab in the dark. Anyway, patch
> attached with a viewport that is hopefully big enough for all the SVGs
> we'll ever see. :)
> 

With this last patch V4, insert-image works well for the various SVG images I tested.
Centering image on the line using the :ascent center property works well too.

The situation is far better now :-)

Thank you very much!






^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-05 20:04                                       ` David Ponce
@ 2023-08-08 13:58                                         ` David Ponce
  2023-08-08 21:18                                           ` Alan Third
  0 siblings, 1 reply; 32+ messages in thread
From: David Ponce @ 2023-08-08 13:58 UTC (permalink / raw)
  To: Alan Third, Eli Zaretskii, 64908

[-- Attachment #1: Type: text/plain, Size: 2115 bytes --]

On 05/08/2023 22:04, David Ponce wrote:
> On 05/08/2023 20:31, Alan Third wrote:
>> On Sat, Aug 05, 2023 at 08:00:17PM +0200, David Ponce wrote:
>>> On 05/08/2023 19:39, Alan Third wrote:
>>>> On Sat, Aug 05, 2023 at 07:37:01PM +0200, David Ponce wrote:
>>>>>
>>>>> I just tried patch V3, and the result is the same:
>>>>> insert-image produces the same black square of 22x22 pixels.
>>>>
>>>> Can you try changing the initialisation of zero_rect to {0, 0, 10,
>>>> 10}?
>>>>
>>>> I remember a lot of trial and error with this originally, and it looks
>>>> like they may have changed how it works.
>>>
>>> It is better :-)
>>>
>>> Before call to rsvg_handle_get_geometry_for_layer:
>>>
>>> (gdb) print zero_rect
>>> $1 = {x = 0, y = 0, width = 10, height = 10}
>>> (gdb) print viewbox
>>> $2 = {x = 6.9533474147268633e-310, y = 2.3106462124703418e-319, width = 5.8283471538673388e-315, height = 9.8813129168249309e-323}
>>> (gdb) print out_logical_rect
>>> $3 = {x = 6.9533558057749482e-310, y = 6.9533473517748961e-310, width = 1.4821969375237396e-323, height = 3.0586981611317814e-317}
>>>
>>> After call:
>>>
>>> (gdb) print $eax
>>> $4 = 1
>>> (gdb) print zero_rect
>>> $5 = {x = 0, y = 0, width = 10, height = 10}
>>> (gdb) print viewbox
>>> $6 = {x = 7, y = 3, width = 8.70703125, height = 16}
>>> (gdb) print out_logical_rect
>>> $7 = {x = 7, y = 3, width = 8.70703125, height = 16}
>>>
>>> Now I see the image, aligned at bottom right on the line (see the screenshot).
>>
>> OK. I really don't understand how this works, and I'm sure some older
>> version of librsvg required a viewport of zero size, but I don't know
>> which, so this is all a bit of a stab in the dark. Anyway, patch
>> attached with a viewport that is hopefully big enough for all the SVGs
>> we'll ever see. :)
>>
> 
> With this last patch V4, insert-image works well for the various SVG images I tested.
> Centering image on the line using the :ascent center property works well too.
> 
> The situation is far better now :-)
> 
> Thank you very much!
> 

Attached the updated patch V4 so that it can apply on the latest master.

Thanks

[-- Attachment #2: v4-0002-Fix-percentage-sizes-in-SVG-display-bug-64908.patch --]
[-- Type: text/x-patch, Size: 5542 bytes --]

>From b37126c0c72b6949783a3044b44896e0ebbd9606 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sat, 5 Aug 2023 10:39:31 +0100
Subject: [PATCH v4] Fix percentage sizes in SVG display (bug#64908)

* src/image.c (svg_css_length_to_pixels): Make percent units always
return zero and handle font size based units better.
(svg_load_image): Don't rely on the width and height values from the
SVG actually having any useful data, even if they're explicitly set.
---
 src/image.c | 82 +++++++++++++++++++++++++++++++++--------------------
 1 file changed, 52 insertions(+), 30 deletions(-)

diff --git a/src/image.c b/src/image.c
index 06fc44b5abd..29e88f0d752 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11740,6 +11740,12 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
 {
   double value = length.length;
 
+#if ! LIBRSVG_CHECK_VERSION (2, 48, 0)
+  /* librsvg 2.48 lets us define the font size, but earlier versions
+     default to 12 pixels.  */
+  font_size = 12;
+#endif
+
   switch (length.unit)
     {
     case RSVG_UNIT_PX:
@@ -11764,16 +11770,31 @@ svg_css_length_to_pixels (RsvgLength length, double dpi, int font_size)
     case RSVG_UNIT_IN:
       value *= dpi;
       break;
-#if LIBRSVG_CHECK_VERSION (2, 48, 0)
-      /* We don't know exactly what font size is used on older librsvg
-	 versions.  */
     case RSVG_UNIT_EM:
       value *= font_size;
       break;
-#endif
+    case RSVG_UNIT_EX:
+      /* librsvg uses an ex height of half the em height, so we match
+	 that here.  */
+      value = value * font_size / 2.0;
+      break;
+    case RSVG_UNIT_PERCENT:
+      /* Percent is a ratio of the containing "viewport".  We don't
+	 have a viewport, as such, as we try to draw the image to it's
+	 'natural' size rather than dictate the size as if we were
+	 drawing icons on a toolbar or similar.  This means that
+	 percent values are useless to us and we are best off just
+	 drawing the image according to whatever other sizes we can
+	 derive.
+
+	 If we do set explicit width and height values in the image
+	 spec, this will work out correctly as librsvg will still
+	 honour the percentage sizes in its final rendering no matter
+	 what size we make the image.  */
+      value = 0;
+      break;
     default:
-      /* Probably ex or %.  We can't know what the pixel value is
-         without more information.  */
+      /* We should never reach this.  */
       value = 0;
     }
 
@@ -11904,7 +11925,8 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
     }
   else
     {
-      RsvgRectangle zero_rect, viewbox, out_logical_rect;
+      RsvgRectangle  viewbox;
+      double explicit_width = 0, explicit_height = 0;
 
       /* Try the intrinsic dimensions first.  */
       gboolean has_width, has_height;
@@ -11916,34 +11938,27 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 					    &has_height, &iheight,
 					    &has_viewbox, &viewbox);
 
-      if (has_width && has_height)
-	{
-	  /* Success!  We can use these values directly.  */
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
+      if (has_width)
+	explicit_width = svg_css_length_to_pixels (iwidth, dpi,
+						   img->face_font_size);
+      if (has_height)
+	explicit_height = svg_css_length_to_pixels (iheight, dpi,
 						    img->face_font_size);
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
 
-	  /* Here one dimension could be zero because in percent unit.
-	     So calculate this dimension with the other.  */
-	  if (! (0 < viewbox_width) && (iwidth.unit == RSVG_UNIT_PERCENT))
-	    viewbox_width = (viewbox_height * viewbox.width / viewbox.height)
-	      * iwidth.length;
-	  else if (! (0 < viewbox_height) && (iheight.unit == RSVG_UNIT_PERCENT))
-	    viewbox_height = (viewbox_width * viewbox.height / viewbox.width)
-	      * iheight.length;
+      if (explicit_width > 0 && explicit_height > 0)
+	{
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_height;
 	}
-      else if (has_width && has_viewbox)
+      else if (explicit_width > 0 && has_viewbox)
 	{
-	  viewbox_width = svg_css_length_to_pixels (iwidth, dpi,
-						    img->face_font_size);
-	  viewbox_height = viewbox_width * viewbox.height / viewbox.width;
+	  viewbox_width = explicit_width;
+	  viewbox_height = explicit_width * viewbox.height / viewbox.width;
 	}
-      else if (has_height && has_viewbox)
+      else if (explicit_height > 0 && has_viewbox)
 	{
-	  viewbox_height = svg_css_length_to_pixels (iheight, dpi,
-						     img->face_font_size);
-	  viewbox_width = viewbox_height * viewbox.width / viewbox.height;
+	  viewbox_height = explicit_height;
+	  viewbox_width = explicit_height * viewbox.width / viewbox.height;
 	}
       else if (has_viewbox)
 	{
@@ -11957,8 +11972,15 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 	{
 	  /* We haven't found a usable set of sizes, so try working out
 	     the visible area.  */
+
+	  /* FIXME: I'm not sure exactly how librsvg uses this
+	     viewport input here, so I'm not sure what values I should
+	     set. */
+	  RsvgRectangle max_viewport_rect = {0, 0, UINT_MAX, UINT_MAX};
+	  RsvgRectangle out_logical_rect;
+
 	  rsvg_handle_get_geometry_for_layer (rsvg_handle, NULL,
-					      &zero_rect, &viewbox,
+					      &max_viewport_rect, &viewbox,
 					      &out_logical_rect, NULL);
 	  viewbox_width = viewbox.x + viewbox.width;
 	  viewbox_height = viewbox.y + viewbox.height;
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-08 13:58                                         ` David Ponce
@ 2023-08-08 21:18                                           ` Alan Third
  2023-08-08 22:22                                             ` David Ponce
  0 siblings, 1 reply; 32+ messages in thread
From: Alan Third @ 2023-08-08 21:18 UTC (permalink / raw)
  To: David Ponce; +Cc: Eli Zaretskii, 64908-done

On Tue, Aug 08, 2023 at 03:58:25PM +0200, David Ponce wrote:
> On 05/08/2023 22:04, David Ponce wrote:
> 
> Attached the updated patch V4 so that it can apply on the latest master.

I've pushed to master, so I think we're done here.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 32+ messages in thread

* bug#64908: 29.1; svg parse failure
  2023-08-08 21:18                                           ` Alan Third
@ 2023-08-08 22:22                                             ` David Ponce
  0 siblings, 0 replies; 32+ messages in thread
From: David Ponce @ 2023-08-08 22:22 UTC (permalink / raw)
  To: Alan Third, Eli Zaretskii, 64908-done

On 08/08/2023 23:18, Alan Third wrote:
> On Tue, Aug 08, 2023 at 03:58:25PM +0200, David Ponce wrote:
>> On 05/08/2023 22:04, David Ponce wrote:
>>
>> Attached the updated patch V4 so that it can apply on the latest master.
> 
> I've pushed to master, so I think we're done here.

Great! Thank you!





^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2023-08-08 22:22 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28  1:10 bug#64908: 29.1; svg parse failure Daniel Vianna
2023-07-28  6:05 ` Eli Zaretskii
     [not found]   ` <CAMLJ+NHO38NYGPctAj9MmMwy4tz8aSqHgLDWQhQaDm7FUP7Yqw@mail.gmail.com>
2023-07-28 11:00     ` Eli Zaretskii
2023-07-28 12:48       ` Visuwesh
2023-08-03  8:11         ` Eli Zaretskii
2023-08-03 19:16 ` David Ponce
2023-08-04  5:23   ` Eli Zaretskii
2023-08-04  7:55     ` David Ponce
2023-08-04 10:26       ` Eli Zaretskii
2023-08-04 16:23         ` David Ponce
2023-08-04 18:32         ` Alan Third
2023-08-04 19:08           ` Eli Zaretskii
2023-08-04 21:08             ` David Ponce
2023-08-05  8:30               ` David Ponce
2023-08-05  9:58                 ` Alan Third
2023-08-05 10:07                   ` Eli Zaretskii
2023-08-05 10:24                     ` Alan Third
2023-08-05 10:41                       ` Eli Zaretskii
2023-08-05 12:32                   ` David Ponce
2023-08-05 15:14                     ` Alan Third
2023-08-05 15:53                       ` David Ponce
2023-08-05 16:02                         ` Alan Third
2023-08-05 16:24                           ` David Ponce
2023-08-05 16:31                             ` Alan Third
2023-08-05 17:37                               ` David Ponce
2023-08-05 17:39                                 ` Alan Third
2023-08-05 18:00                                   ` David Ponce
2023-08-05 18:31                                     ` Alan Third
2023-08-05 20:04                                       ` David Ponce
2023-08-08 13:58                                         ` David Ponce
2023-08-08 21:18                                           ` Alan Third
2023-08-08 22:22                                             ` David Ponce

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).