Where does Obsidian look for images in documents

Things I have tried

What I’m trying to do

I have a document (at the root of the vault) with a number of pasted images. All of them get saved in the same folder.
I decided to move one of my pasted images to a folder Images under the vault folder.
I found that the image is still visible (good!) but I do not know how this is accomplished. Actually, looking inside the .md file which contains the image, I find the image name without the path as it was before moving the image file. Where is the folder information?
So I suppose that Obsidian looks for the image name in the vault and relevant sub-folders.
Can somebody confirm?
Thanks

1 Like

In Obsidian Settings, Click Files & Links, in “Default location for new attachments"and choose ïn the folder specified below”. under that is the place to choose your Attachments folder (or whatever folder you specify).

Thank you very much, I already know this setting.

My question is different: I try to explain it again in short.

  • My setting for “Default location for new attachments" is “Vault folder” (the default).
  • One of my images is located in a different folder: (Vault)/Images.
  • I was expecting a problem.
  • But Obsidian actually finds and correctly shows such image.

Does this mean that Obsidian looks also inside the sub-foders of the “Default location”?

I would like to understand how it is working.

Obsidian finds things by shortest path possible. Which, if the name is unique, can just be the name. It looks everywhere inside your vault.

This is related to this setting:
Settings → Files & Links → New Link Format

That setting only affects how new links get created, not how Obsidian finds things.

Also “Default location” is just where it gets placed. Not where it looks.

If you set that “New Link Format” to Relative or Absolute, it will use the whole path. But it doesn’t have to. Even with the setting set to Absolute, if you have a unique name, you can remove the path and it will still find it.

If you have two images with identical names in different places, Obsidian will be forced to apply a shortest-path to be able to distinguish them. But - and I have no idea how - it will find one of them if you don’t include the path. (Or maybe the link will break. I haven’t tested this in over a year.)

2 Likes

Thank you @rigmarole.
I made some experiments by moving, duplicating, deleting images and now it is clear for me that it does not matter where the image is located - provided that it can be found in any sub-folder of the vault, at any level.