bibnotes
bibnotes copied to clipboard
[Feature Request] Image import not relying on temporary Zotero image filenames (related: "add note from annotations")
Currently the images that are imported into Obsidian are tied to the Zotero folder name where that image is stored. When we use the "add note from annotations" feature in Zotero, it creates an annotation note whose embedded images are stored in a temporary location managed by Zotero. When we use that feature again Zotero doesn't overwrite the previous annotation note and instead creates a new one with its own set of temporary folders/images. As far as I'm aware there's no way to overwrite the existing annotation note.
This isn't an issue if you like to keep a history of the progress of your annotations, but I would assume for most people it's not important, so what you really care about is the latest version of your annotations note in Zotero, and here we come to a few problems.
Problem 1 - Bloat
If you're just deleting and re-importing the latest annotation then Bibnotes will just keep copying the latest iteration of image files with their temporary names inherited from the Zotero folder, which means your image storage will get bloated with copies of the same image every time you re-import your annotations note. Perhaps you could do a regular emptying of the folder, but this brings us to the second (and perhaps more important) issue
Problem 2 - Broken Links
Every time you "add note from annotations", re-import the images and clear the old images all the links to the relevant image will be deleted since the newly imported images have a new filename.
Problem Summary
Perhaps the workflow looop of
- Annotate in Zotero
- Export to note
- Import to Obsidian is not a common one, I don't know, but currently it gets punished with data bloat equivalent to (images N)*(loop count).
Proposed Solutions
Since the author is currently busy and can't dedicate the time to this plugin I'm going to try my own hacky solutions along the following lines. Perhaps when/if the author is back he'll find them useful.
Solution 1 - Create image files based on cleaned comment names
This solution involves making a unique (per citeKey) comment on every image reference in Zotero which will be used as the filename for the exported image file (e.g. @citekey_comment_with_underscores).
Pros:
- you have total control over what your exported image files will be named in Obsidian
- this includes re-naming and saving over files as you wish
Cons:
- this obviously requires careful manual management of comments in Zotero
- has the danger of accidentally overwriting existing images if your comment management is bad and because of that
- limits your freedom with comments on Zotero images. Perhaps could implement a substring in comment which will be parsed without touching the rest of the file.
Solution 2 - Check for existing files
Since we can't rely on image names, we can search the image folder for already existing and check if the content of the new image is similar to the content of one of the existing images.
Pros: You don't need to mess with image comments in Zotero, things should happen automatically - when you export an image it will get its temporary name and will only be updated when an image with different content is created.
Cons:
- need to search the image folder for similar images
- the search is probably not viable for large databases so we'd likely need to implement a sub-layer of folders so that we'd only need to search images in the folder relevant to the pdf
- no control over filenames in Obsidian
Conclusion
I think I will do a hack for version 1, probably for general public version 2 is better. Perhaps all of this is only relevant to me, but it seemed relevant to post here. I've been trying to closely integrated Zotero and Obsidian for purposes of academic work as well as roleplaying games like DnD - both require a lot of jumping between note and PDF as well as quick reference capabilities.