meld-cp / obsidian-encrypt

Hide secrets in your Obsidian.md vault
MIT License
587 stars 36 forks source link

Allow pasting images in an encrypted note #170

Open thibaultmol opened 1 month ago

thibaultmol commented 1 month ago

I don't think it's possible atm to save an image (encrypted) inside of an encrypted note. That would be pretty convenient

carlgustavh commented 1 month ago

Hey mate, I have a bit of an annoying workaround for you:

  1. Convert your image to Base64 at https://www.base64-image.de
  2. Copy the Base64 and make an HTML element in your encrypted note where you put the Base64 after data:
    <img src="data:">
MaelImhof commented 1 month ago

It can be done manually, but the plugin could propose to do it automatically when right-clicking on the image for example.

Or even better, a setting to do that automatically when an image is added into an encrypted note.

meld-cp commented 1 month ago

An auto convert from clipboard to data:base64 image would be pretty neat. (It could even be a standalone plugin, if it doesn't already exist)

Source view would look quite bad if the user pastes in a large image though.

But I think it's worth an try 🤔

Drop in any use cases or implementation ideas here if you have them.

thibaultmol commented 1 month ago

@carlgustavh funnily enough, i was thinking of base64 as well but forget there was arleady a way to do it in obsidian.

but yeah as @MaelImhof and @meld-cp a slight automation would be nice. i'll do it manually for now

meld-cp commented 1 month ago

Yeah, I can imagine a workflow for pasting an image from the clipboard or dragging one in and have this (or another) plugin convert it into an embedded base64 image.

Curious if anyone is using the beta versions by chance? I'd like to release it soon but I'm unsure how much it's been tested out in the wild.

meld-cp commented 1 month ago

I haven't tested it but found this after a quick browse through the plugins:

https://github.com/ZackaryW/obsidian-image-inline

It may work quite well with the new editor in the beta releases.

I might give it a try on the weekend.