jupyter-org--image-result: Fix a few issues

* jupyter-org-client.el (jupyter-org--image-result):
Be more stringent on checking the value of `org-image-actual-width`. `listp`
returns t when passed nil, a valid value of `org-image-actual-width`.

Use absolute filenames when calling `create-image`.
This commit is contained in:
Nathaniel Nicandro 2019-07-14 17:52:32 -05:00
parent 2992e24e57
commit cb1efa4268

View file

@ -903,8 +903,10 @@ the image may still be added, see
metadata metadata
(if (and (null width) (if (and (null width)
jupyter-org-adjust-image-size jupyter-org-adjust-image-size
(listp org-image-actual-width)) (numberp (car-safe org-image-actual-width)))
(let ((image-width (car (image-size (create-image file) 'pixels)))) (let ((image-width (car (image-size
(create-image (expand-file-name file))
'pixels))))
(if (< image-width (car org-image-actual-width)) (if (< image-width (car org-image-actual-width))
(setq width image-width)))) (setq width image-width))))
(jupyter-org-image-link file width height)))) (jupyter-org-image-link file width height))))