mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
jupyter-repl-insert-data: Support image/jpeg
jupyter-repl.el (jupyter-repl-graphic-mimetypes): Add :image/jpeg. (jupyter-repl-insert-data): Add the support.
This commit is contained in:
parent
fb55644d17
commit
4d4da4fcdc
1 changed files with 6 additions and 1 deletions
|
@ -482,7 +482,7 @@ can contain the following keywords along with their values:
|
|||
|
||||
;;; Handling rich output
|
||||
|
||||
(defvar jupyter-repl-graphic-mimetypes '(:image/png :image/svg+xml :text/latex)
|
||||
(defvar jupyter-repl-graphic-mimetypes '(:image/png :image/jpeg :image/svg+xml :text/latex)
|
||||
"Mimetypes that display graphics in the REPL buffer.")
|
||||
|
||||
(defun jupyter-repl-graphic-data-p (msg)
|
||||
|
@ -674,6 +674,11 @@ When no valid mimetype is present in DATA, a warning is shown."
|
|||
(jupyter-repl--insert-image
|
||||
(plist-get data :image/svg+xml)
|
||||
'svg (plist-get metadata :image/svg+xml)))
|
||||
((memq :image/jpeg mimetypes)
|
||||
(setq mimetype-inserted :image/jpeg)
|
||||
(jupyter-repl--insert-image
|
||||
(base64-decode-string (plist-get data :image/jpeg))
|
||||
'jpeg (plist-get metadata :image/jpeg)))
|
||||
((memq :image/png mimetypes)
|
||||
(setq mimetype-inserted :image/png)
|
||||
(jupyter-repl--insert-image
|
||||
|
|
Loading…
Add table
Reference in a new issue