Puede usar la siguiente función reescrita para mostrar imágenes en línea, así como imágenes web (exactamente como la forma de mostrar imágenes en línea) en modo Org (si su entorno de trabajo está en modo Org).
- cuando se visualiza la imagen en línea, generará un archivo en miniatura en el disco local y lo mostrará. Al usar esto, puede anotar su imagen de la manera más libre posible sin dañar su imagen original.
- cuando muestre la imagen de la URL, guardará la imagen en una variable y la mostrará sin ninguna descarga.
Cualquier extensión puede ser posible. Por supuesto, puede mostrar la imagen en línea, pero no generar el archivo del pulgar cambiando ligeramente. Pero prefiero la forma anterior.
(defun org-display-inline-images (&optional include-linked refresh beg end)
"Display inline and url images.
Normally only links without a description part are inlined, because this
is how it will work for export. When INCLUDE-LINKED is set, also links
with a description part will be inlined. This
can be nice for a quick
look at those images, but it does not reflect what exported files will look
like.
When REFRESH is set, refresh existing images between BEG and END.
This will create new image displays only if necessary.
BEG and END default to the buffer boundaries."
(interactive "P")
(unless refresh
(org-remove-inline-images)
(if (fboundp 'clear-image-cache) (clear-image-cache)))
(save-excursion
(save-restriction
(widen)
(setq beg (or beg (point-min)) end (or end (point-max)))
(goto-char beg)
(let ((re (concat "\\(\\(http\\)\\|\\(\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\)\\)\\([^]\n]+?"
(substring (org-image-file-name-regexp) 0 -2)
"\\)" (format "\\(\\(\\]%s\\)\\|\\)" (if include-linked "" "\\]"))))
old file ov img width point-begin point-end)
(while (re-search-forward re end t)
(setq old (get-char-property-and-overlay (match-beginning 1)
'org-image-overlay)
match (match-string-no-properties 0)
point-begin (match-beginning 0)
point-end (match-end 0))
(if (s-starts-with? "http" match)
(save-excursion
(let* ((buffer (url-retrieve-synchronously match))
(unwind-protect
(let ((data (with-current-buffer buffer
(goto-char (point-min))
(search-forward "\n\n")
(buffer-substring (point) (point-max)))))
(require 'image+)
(setq img (imagex--fit-to-size (create-image data 'jpeg t) 400 400)))))))
(setq file (expand-file-name
(concat (or (match-string 6) "") (match-string 7)))
width (if (eq (car (org-element-property :parent (org-element-at-point))) 'table) 200 400))
(when (file-exists-p file)
(let ((file-thumb (format "%s%s_thumb.png" (file-name-directory file) (file-name-base file))))
(if (file-exists-p file-thumb)
(let ((thumb-time (nth 5 (file-attributes file-thumb 'string)))
(file-time (nth 5 (file-attributes file 'string))))
(if (time-less-p thumb-time file-time)
(shell-command (format org-imagemagick-display-command
file width width file-thumb) nil nil)))
(shell-command (format org-imagemagick-display-command
file width width file-thumb) nil nil))
(if (and (car-safe old) refresh)
(image-refresh (overlay-get (cdr old) 'display))
(setq img (save-match-data (create-image file-thumb)))))))
(when img
(setq ov (make-overlay point-begin point-end))
(overlay-put ov 'display img)
(overlay-put ov 'face 'default)
(overlay-put ov 'org-image-overlay t)
(overlay-put ov 'modification-hooks
(list 'org-display-inline-remove-overlay))
(push ov org-inline-image-overlays)))))))