Distinguish images dragged/sent to Obsidian from images orphaned by deleting markdown files

What I’m trying to do

I am looking for any way to distinguish images that were dragged/sent to Obsidian vs images that were orphaned by deleting a file that embedded the image, so that the latter can be periodically deleted.

Things I have tried

  • Used plugin “Find orphaned files (files with no backlinks) and broken links” has features to find and delete images that are not embedded anywhere, but to my knowledge, it can’t distinguish between orphaned images and images that were purposely sent to Obsidian from Android or dragged from Windows 11. Orphaned images and purposely solitary images both show up in the attachments folder and since they are not embedded in any existing notes, they are all technically orphans. (Accidentally deleted some images this way.)

  • Read the description of the plugin “Clear unused images,” which says “The plugin simply gets all of your image links from all the markdown documents and compares these images with all image files you have available in your vault. In case any of these image files are not referenced in any document of the vault, they will be automatically deleted.” That would delete both the dragged/dropped/sent images and the images that were orphaned from deleted markdown files.

  • Thought about Dataview queries, but they only see markdown files.

  • Wondered if there is a way to set up some trigger on images arriving in my attachments folder directly (without an accompanying markdown file), and then automatically embed them in a note of some kind, or something like that.

The “Find orphaned files” plugin allows you to exclude folders, so you could treat the default attachments folder as an inbox, moving files from it to another folder when you use them. Purposely solitary images would go into a different folder which you would also exclude. (This obviously adds more work to your system.)

Or, simpler — process your imported images regularly and often, embedding them where they need to go or moving them to an excluded folder. That way you can know that any remaining strays are actually orphans.

Yes, but then if you embed that file in an actual note later, and then orphan it, you won’t know that it’s an orphan because it will still be embedded in the original “auto-embed” note (unless you take the trouble to remove that note when you use the image somewhere, which brings you back to doing more work as in the other solution). If you want to do this you could use the Binary File Manager plugin with adds a note for each attachment, or use the Waypoint plugin to generate a list of all the files in a folder.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.