Only the first local image will render on a table
See original GitHub issueWhat happened?
When I display local images in Dataview, only the first image will appear. The subsequent images don’t have an img tag within them and don’t display. If I change the sort on the table to change the order in which items appear, the one that was displaying stops working and the one that wasn’t displaying begins to display.
- Image A (displays)
- Image B (doesn’t display)
change sort from asc to desc:
- Image B (displays)
- Image A (doesn’t display)
If I group my results, the first entry for each group will display.
Console is empty with no errors.
For testing purposes I created two files that only contain front matter:
---
image: 1984%20The%20Graphic%20Novel%20(2021).jpg
---
and
---
image: 4%20Kids%20Walk%20Into%20A%20Bank%20(2016).jpg
---
DQL
dv.table(["Cover", "Name"],
dv.pages('"Notes/Comics"')
.where(f => f.image)
.sort(f => f.image, 'asc')
.map(k => [`![](${k.image})`, k.file.link]))
dv.table(["Cover", "Name"],
dv.pages('"Notes/Comics"')
.where(f => f.image)
.sort(f => f.image, 'desc')
.map(k => [`![](${k.image})`, k.file.link]))
JS
No response
Dataview Version
0.4.26
Obsidian Version
0.13.23
OS
Windows
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
How to render **local** image in pandas dataframe
png , this simple solution seems to work (I see the pictures rendered in the HTML table). import pandas as pd from IPython.core.display...
Read more >Images not rendering in table · Issue #114 · glin/reactable
I'm almost there with completing my first table using the reactable package, however the images I'm trying to add into the table aren't...
Read more >Lazy Loading Images – The Complete Guide - ImageKit.io
Images on a webpage can be loaded in two ways - using the <img> tag, or using the CSS `background` property. Let's first...
Read more >Render local images in datasette using ... - Technical Ramblings
Render local images in datasette using datasette-render-local-images ... Datasette python library lets publishing a dataset as a SQLite database and inspects them ...
Read more >Helper function for adding a local image — local_image • gt
We can flexibly add a local image (i.e., an image residing on disk) inside of a table with local_image() function. The function provides...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Figured out the img src on mobile. Had to use
<img src="${app.vault.adapter.getResourcePath("Media/Comics/"+k.cover)}">
to get it to render properly.Thank you @chelming!
I now use
<img src="${app.vault.adapter.getResourcePath(p.avatar.path)}">
.avatar
is a field, the value could be![[img.png]]
.It works on macOS and iOS.