Please exclude base64 image from search result by deafult

Use case or problem

If you use some webclip or image paste plugin which convert image to base64 , you search would easily hit those images , very painful .

I think base64 is a greate way to carry images together with content on just one single file.

I also found there is a similar question How to exclude images from search results - #2 by scholarInTraining .

Proposed solution

exclude base64 image from search result

4 Likes

I encountered this same problem. It is really painful. Is there any way to solve it? or a workaround?

3 Likes

Encountering the same problem!!! Would love to find a way to just completely exclude all media from search, limiting it to just .md notes!!!

1 Like

also have this problem (migrating from onenote autmatically leads to base64-encoded images)

Use case or problem

In some cases, I have images embedded in my markdown-files using the base64 representation of the image (mostly in documents which I have converted from docx Word-Files when I switched away from MS-Office toward Obsidian).

As a consequence, using the global search sometimes produces bogus-results cluttering the result-list because the search-query just happens to be contained in the base64 representation of some image somewhere.

Proposed solution

The content of data-urls of e.g. format data:image/png;base64 could be excluded from the search. I sincerly doubt that anyone will ever try to search for those base64 strings.

Current workaround (optional)

Well you can of course include the images as separate files - but only if you still have them.

A piece of friendly advice: get rid of those bogus images.
You can also hunt some Word macros off of the net which will yield full resolution image files of your doc files.

hello , I wrote a python script which can replace your base64 picture with the oridinary picture. This is the url : “ht请tps://github.com/WuHong删除Qiang333/repalc我e_base64pic_with_pic_in_obsidian/blob/main/replace_pic_of_base64_in_obsidian.py”

Search results display matching strings from within image-data (a pasted image)

I’m searching for DMZ in my notes (as an example), and the top result is this large string
“…mQ6E5EMBx…DMZ…INENtsBblg…”
If I click on it, I am taken to a page filled with the same gibberish text.
If I hit ctrl+Home or ctrl+End, suddenly the gibberish text is replaced with an image. Turns out I was looking at the text of pasted-in image.

I found this happens when I copy images from my email client.
Here’s an example of a tiny-square image as copied to obsidian:

Proposed solution

I propose that when matching strings in search, if it’s from inside a data:image/ tag that it be ignored / dropped from the search results.
I don’t know anyone who’s going to be searching for text within the base-64 encoded text of an image.
Now if they’re searching specifically for data:image/png;base64… that might still be relevant.
But not for me. I never pay attention to the format in which I paste images.

Current workaround (optional)

Workaround; ignore search results when I see them, often scrolling down to see relevant results.

tiny square actually worked! But I meant to paste to show how it looks in raw text form:

!(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAaCAYAAACgoey0AAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAAtdEVYdENyZWF0aW9uIFRpbWUAVHVlI…

If you want to post code, mark it as code the way you would in Obsidian: Basic formatting syntax - Obsidian Help