I made a Wine Cellar Tracker and want to see the images of the labels in the first column of a table view with Bases. I added the image with the image() function. The problem is that currently the image is always fitted to the width of the column. As long as the height of the row is larger than the scaled image everything is fine.
When the height of the image is larger than the height of the row the image got stretched.
The picture shows the problem. On the left side everything is fine. On the right side the column width is so large that the scaled image height is larger than the row height and the image is stretched.
Proposed solution
Please keep the aspect ratio of the images and donât stretch them.
I discovered that the problem is only there, if you use a bases view inside another note. I made the table view and in the original bases file the aspect ratio stays constant. As soon as I integrate the bases view in another note (with ![[name.base]]) the view acts differently. Now the aspect ratio is not constant (as described in my original post above).
So maybe itâs a feature request or a bug report?
I tested the problem in a sandbox vault. The problem is the âMinimal Themeâ. With the default theme everything works as expected. With the Minimal Theme the picture aspect ratio is not constant when you integrate a base with images in a note. You can switch the behaviour on and off by changing the theme.
I havenât checked, but it could be Minimalâs âMaximize mediaâ setting (in Minimal Theme Settings). Iâd let them know on their GitHub page if you have time.
It worked as expected with disabling the âMaximize Mediaâ setting. Iâve posted the topic on the Github pages of the Minimal Theme and someone wrote this hint, too.
Iâve been trying to figure out how to get images to display in bases table view just like Peptino has in the first post, but canât get it to work - i either get âinvalid formulaâ or when itâs valid the column is just blank. whatâs the secret??
thanks ariehen, putting the YAML property name (in your case bookCoverURL, in my case, just âimageâ) is the trick. Not being a coder/programmer myself i could not interpret what the documentation meant when it said âstringâ how all those pipes functioned (Functions - Image()). From using formulas in excel i wrongly guessed the pipes were arguments and some had to be kept empty.
And properties with spaces or hyphens (the hyphen is read a minus symbol for subtraction), while totally valid property names, need special care in formulas. e.g.
Something interesting now: my image property is a list and for some records i have more than one image listed. In Bases Cards view, the image âcoverâ pulls the first image from the image property even though that property is a list. In the Table view, the image function cannot handle a list property and wonât pull any image (will instead error, saying the function expected a string but got a list). Iâll have to rethink how i store multiple images for a record. But at least iâm getting closer!