MSzturc / obsidian-advanced-slides

Create markdown-based reveal.js presentations in Obsidian
https://mszturc.github.io/obsidian-advanced-slides/
MIT License
987 stars 82 forks source link

Images do not appear in slide presentation in the browser #176

Open marconoris opened 1 year ago

marconoris commented 1 year ago

Hi,

everything great but... images do not appear in slide presentation in the browser:

I use wikilinks: ![[files/IMG_3311.JPG]] that in browser is <img src="files/IMG_3311.JPG" alt="" style="object-fit: scale-down">

Obsidian 1.0.3 / Mac OS Ventura 13.0.1 / Safari 16.1

vimkim commented 1 year ago

I can reproduce the same bug. Currently the best way to show my slides to others (except for exporting them) is to show them full screen in the browser. I hope this bug gets resolved soon.

MSzturc commented 1 year ago

Im not able to reproduce this bug. Can you provide me a sample vault?

marconoris commented 1 year ago

Im not able to reproduce this bug. Can you provide me a sample vault?

I tested plugin in a new empty vault and it works so... there might be some plugin that conflicts...

jschnitter commented 1 year ago

I encountered this problem as well and from what I can tell the issue is specifically with images that are not in the same directory as the markdown file.

In a new vault, I used this markdown file:

# Image Test

---

# PNG

![[images/image.png]]

---

# SVG

![[images/image.svg]]

It renders fine in the Obsidian edit tab and in the Advanced Slides Preview window. The images are not present in presentation mode in the browser.

Developer tools in the browser show 404 errors for the images in question.

I also encounter problems with images not showing in presentation mode if my slide markdown file is in a subdirectory, even if the images are in the same directory as the markdown file.

My environment:

jschnitter commented 1 year ago

Wanted to provide some additional observations and a workaround.

It appears that the problem will occur whenever images are not in the root of the vault.

Sample vault file structure that will exhibit the problem:

├── slides
│   ├── slideshow-1
│   │   ├── slideshow.md
│   │   ├── image.png
│   │   └── image.svg
└── templates
$ cat slideshow.md

# Image Test

---

# PNG

![[image.png]]

---

# SVG

![[image.svg]]

Images render in the Obsidian edit tab and the Advanced Slideshow Preview, but not in the browser. In Chrome, View -> Developer -> Inspect Elements -> Sources tab shows no folder under localhost:/slides/slideshow-1.

Workaround:

Changing the image path to be relative to the vault root results in the images not being visible in the Advanced Slides Preview tab, but they will be visible in the browser, ie from my example above:

$ cat slideshow.md

# Image Test

---

# PNG

![[slides/slideshow-1/image.png]]

---

# SVG

![[slides/slideshow-1/image.svg]]

The images will appear In Chrome, View -> Developer -> Inspect Elements -> Sources tab under localhost:/slides/slideshow-1.

snrbrnjna commented 10 months ago

+1