Searching file for images

Is there a way to search my TBx file for images in order to replace them with links. I have not been able to find how to build tha query that will find all notes containing one or more images. I think it should be along the lines of: $Text.contains(matchStr) where the string contains characters unique to images. Perhaps a regex is needed?

I’ve searched the Forum and the rich aTbRef without success to find how inline images are stored in a note.

I have not used images extensively but recent discussions in the Forum and email correspondence suggest the speed of the file could be boosted by removing images.

For context, I consider my file a modest one at 473 MB with 11 children, 2045 descendents, and 147,146 words with descendants.

Sample file attached with one note and one image. As I was not sensitive to storage space issues, the image in the test has not been processed in any way to reduce its size. That is also true with the images in my work file.

ImageTest.tbx (36.5 MB)

You can find notes with images by writing an agent that looks for $ImageCount>0.

On balance, Tinderbox’s image handling is much better than it used to be.

That works: found 56. Will now work on lodging them elsewhere.

Thanks.

Agree re: improved handling.

Am just looking for some optimization.

I’d be interested in what you’re working on. For my work, I’ve found hosting the image on my hardriving and “pulling” the image through preview/export is the most optimal approach.

We’ve held several meetups on image managment, e.g., Tinderbox Training Video 12 - Working with media in your TBX files (Part 1), Tinderbox Training Video 13 - Working with media in your TBX files (Part 2)

I’ve also build a template around it: 5Cs TBX Media Libraries and Templates | 5Cs of Knowledge Management

Thanks for your note, Michael. I had looked at your video in 2021 but confess to having overlooked when researching for this exercise. Have rewatched Part 1 and tried to implement. The video is packed with great information. TextExpander will be a big help, especially when the $MediaFile value in included.

I use this tag: <img src=“File:////Users/doug_user/Library/CloudStorage/Dropbox/Tinderbox/CatchAllNotesImages/Medicare_DJ.png"> in a note. The folder with images is in the folder that contains the TBX file. However, when I click “Preview” I get only the line or two of unrelated text in the note and not the image. In the Preview, the tag is not visible, just open space. I tried both jpg and png versions of the image with same result.

When I try linking to an image on my local HD, the tag works. Is the location on Dropbox in the Cloud the issue? When I use the path beginning with “File:” in $URL and click the globe, it opens the image immediately in Preview.app.

I’m totally ignorant on HTML so am wondering if there are some elements there that would help TBX make the connection.

Hoping there is an easy answer but will adjust if needed.

Not, this is a VERY old video…text expander is fine to use especially when you’re working with long form documents, but so is the use of templates and ^include("note-name","tMedia template")^ is also my recommended approach. I don’t think Part 1 or Part 2 talk about the include approach.