Open Elijer opened 3 months ago
Hi, glad you are getting good use from the plugin.
You have brought up a number of points here, so let's discuss how you think it should work, and then I'll see if it's something I think I can support.
Thanks for engaging with these ideas so quickly!
So that said, this is what I’m thinking in terms of action:
For compression, how would it work? Should every image be compressed, or just those over a certain size? How much should they be compressed? Which file types should be compressed? Should we convert file types, ie. PNG to JPG? Should there be a way to disable/enable compression at the note level (I have been pretty careful to enable frontmatter versions of all the settings, since people use their vaults for all kinds of different things, and one size doesn't necessarily fit all.
What do you mean by "the note level"? I would really like to appreciate you being careful to enable frontmatter versions of all types but might need your help understanding what this means, as I don't know the full range of how Obsidian is used - I'd imagine it's quite broad!
These are great questions. For "how would it work", I think I was thinking a per-file-setting that could be turned off by default where the user specifies a file size in, to start with, just PNG and JPG, and if an uploaded file is above that size, it is compressed before upload. I was thinking something like this:
JPEG Compression: On
Compress after JPEGs are above this file size: 2MB
PNG Compression: On
Compress after PNGs are above this file size: 2MB
by "the note level" I mean a setting which is set specifically for one particular note, where it is different than the settings that apply generally. For example, I have some notes where I upload the media to a different bucket, because they are for work. The point is that for every setting, there is often a use case where it needs to be set different at the note level, and then the settings need to supported by setting it in the frontmatter (which exists in every note individually) rather than in the global settings (which would be used for all notes by default.)
Hey! First off, I love this plugin and if anything it works too well. It's sort of changed my life - the ability to express not only what I'm working on but easily upload images to my blog that fluently describes it in the IRL terms of photos and videos has allowed me to blog approaching much closer to the speed of thought and experience than I thought possible. I've been uploading media like crazy. So far still paying 5 cents a month for my S3, but I can see this going up a bunch.
The main concerns I see are around 1) The deletion of unused media - if I upload an image and then realize it was wrong, or needs to be resized or updated etc. then I will delete that link, and it will just be hanging in my S3, unreferenced and unused. I don't see anything built in that automatically deletes media from the bucket that are not being used - which doesn't surprise me, as automatically deleting things probably comes with at least a few decisions to make. I mean for one, what if an image is referenced twice in a vault? Then a listener would need to be created that checks to see if a reference to media was removed, and if that reference exists anywhere else, and only delete the file from S3 if both of those conditions are met
2) Media resizing - this is related, as this is probably why I've deleted and replaced media most often so far. It would be nice to just have a catchall media upload configuration that would resize images that are too large, or even just prevent them from being uploaded.
3) S3 directory creation / metadata - this is a floating idea, but I wonder if some metadata could be added to S3 files that shows the path of the file that originally uploaded them.
This is a lot, but I am interested in extending the functionality of this plugin in these ways in the future and wondered if anyone had thought about these features.