1
0
Fork 0

- ensured also PNG file are scaled when rendering the gemtext.

This commit is contained in:
cage 2023-09-11 19:08:28 +02:00
parent 676cf0759f
commit 8486e6eea4
1 changed files with 5 additions and 0 deletions

View File

@ -448,6 +448,9 @@
(defun scale-targa (main-window file)
(scale-pixmap main-window file 'nodgui.pixmap:tga))
(defun scale-png (main-window file)
(scale-pixmap main-window file 'nodgui.pixmap:png))
(defun inline-image (main-window link-value line-index)
(multiple-value-bind (file-path mime-type)
(slurp-iri main-window (remove-standard-port link-value))
@ -456,6 +459,8 @@
(scale-jpeg main-window file-path))
((member mime-type '("image/x-tga" "image/x-targa"))
(scale-targa main-window file-path))
((string= mime-type +mime-type-png+)
(scale-png main-window file-path))
(t
(gui:make-image file-path))))
(coordinates `(+ (:line ,line-index :char 0) 1 :lines)))