org-roam-ui icon indicating copy to clipboard operation
org-roam-ui copied to clipboard

Display images from org-download

Open hy-zhao23 opened this issue 2 years ago • 5 comments

I have several separated local roam directories. And with each I set up a separated image folder for it as following:

(add-hook 'dired-mode-hook 'org-download-enable)
(add-hook 'org-mode-hook
          (lambda ()
            (setq-local org-download-image-dir (concat "./.media/" (file-name-sans-extension (file-name-nondirectory  (buffer-name)))))))

The preview in UI graph can not display images from org-download. image

hy-zhao23 avatar May 17 '22 02:05 hy-zhao23

I'm having a similar issue on Windows, trying to display an image linked in the following way: [[C:/project/counts.png]] Instead, the rendered URL in the org-roam-ui sidebar's preview includes my org-roam-directory like so: c:/roam/C:/project/counts.png which of course returns 404

Osherz5 avatar Mar 06 '23 13:03 Osherz5

Try using relative paths like:

[[counts.png]] or [[media/image.jpg]]

ParetoOptimalDev avatar Mar 06 '23 14:03 ParetoOptimalDev

Org download is using relative paths for me, but they're adding download: in front of them which is messing the ui up. Removing that seems to break the inline display on emacs.

Dev380 avatar Sep 29 '23 01:09 Dev380

@Dev380 I don't think org-mode supports inline display of anything except image filepaths.

NOTE: I'm on emacs master, so some or all of my advice may not apply.

See the help for org-display-inline-images:

  2. Its description consists in a single link of the previous
     type.  In this case, that link must be a well-formed plain
     or angle link, i.e., it must have an explicit "file" or
     "attachment" type.

But I just tested the attachment type and couldn't even get it to work. Actually...

If I add a description it breaks it.

Anyway, I think it's not supported or there is a bug but give leaving the description empty a try and see if that works.

ParetoOptimalDev avatar Oct 02 '23 20:10 ParetoOptimalDev

I found that you can fix the problem with descriptions by calling (org-display-inline-images t) which makes INCLUDE-LINKED true.

I'm not sure why it doesn't resolve the link by default and goes by description text...

ParetoOptimalDev avatar Oct 02 '23 20:10 ParetoOptimalDev