From 8486e6eea4f513f680e4f685e322b857b1a5141e Mon Sep 17 00:00:00 2001 From: cage Date: Mon, 11 Sep 2023 19:08:28 +0200 Subject: [PATCH] - ensured also PNG file are scaled when rendering the gemtext. --- src/gui/client/main-window.lisp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/client/main-window.lisp b/src/gui/client/main-window.lisp index 07483f2..c958a22 100644 --- a/src/gui/client/main-window.lisp +++ b/src/gui/client/main-window.lisp @@ -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)))