TomNCatz / obsidian-gallery

Main Gallery to tag / filter / add notes to images. Display blocks to embed images inside notes. Display block to an image information
MIT License
41 stars 3 forks source link

[FR] Let the image automatically have the embedded file's tags. #3

Closed wwjCMP closed 1 year ago

wwjCMP commented 1 year ago

I really hope you can add a feature option to automatically give images the tags of the embedded files.

wwjCMP commented 1 year ago

Alternatively, add a filter that filters based on the labels of the files embedded in the image.

TomNCatz commented 1 year ago

I have not figured out how to do that yet, since files do not all store tags the same way, and in fact a lot of image formats do not have tag support at all. If I figure It out I'll add it.

KuiyueRO commented 1 year ago

Maybe you can automatically replace embedded images with image info files.

TomNCatz commented 1 year ago

Maybe you can automatically replace embedded images with image info files.

The difficulty was still reading out the tags initially. Images are binary files and the tags have to be encoded. Not all tools that edit tags use the same encoding, so I had to find or make tooling that 1 can read the binary file and find the tag section, 2 convert the tags using several widely used encodings, 3 figure out which encoding gave me human readable results(spoiler alert, sometimes there wasn't an encoding available that did that and I had to post process partially decoded results)

I actually have an implementation that works for the most part now, I'm just doing a bit more testing to make sure it's stable before making a release with it.

wwjCMP commented 1 year ago

Has this feature been implemented? I seem to have not found it. There is a feature called "pull meta from file," but I'm not sure if this is it, because I didn't understand how to use it.

TomNCatz commented 1 year ago

Yes. Images that tags can be pulled from will pull them when the image meta is first created, and if you have an old meta file that you want to pull the tags from you can use the "Pull meta from file" option. It is called that instead of just 'pull tags' because it already does not JUST pull tags and may continue to pull more information from the file as the project grows.