Awesome
Obsidian Imgur Plugin
This plugin uploads images to imgur.com instead of storing them locally in your vault.
Why?
Obsidian stores all the data locally by design (which is perfect for text and, in my opinion, can be improved for images). If you often add pictures to your notes, your vault can quickly grow in size. Which in turn can lead to reaching limits if you use free plans of cloud storage services to sync your notes or can lead to growth of repository size if you use git to back up your notes.
This plugin is a perfect solution for people who paste images to their notes on daily basis (i.e. students making screenshots of lecture slides) and do not want to clutter their vaults with image files.
Having remote images also makes it much easier to share a note with anyone else, you will only need to share a single file.
If you are uncertain if this solution is for you, you can check out the FAQ section and/or a video created by @santiyounger discussing pros and cons of this approach
Features
- Upload images anonymously or to your Imgur account
- Upload images by either pasting from the clipboard or by dragging them from the file system
- Animated gifs upload support on drag-and-drop
Installation
Install the plugin via the Community Plugins tab within Obsidian
Getting started
Generating Client ID
For this plugin to work reliably and to avoid hitting daily rate limits from using single shared Client ID, it was decided that each user should create his own "Client ID". Here are the steps:
- If you do not have an Imgur account, you need to get one first - follow https://imgur.com/register
- Being authenticated, go to https://api.imgur.com/oauth2/addclient
- Use any name for "Application name". For example: "Obsidian Imgur plugin"
- Choose "OAuth 2 authorization with a callback URL"
- Important: use
obsidian://imgur-oauth
as an "Authorization callback URL" value - Fill in the "Email" field and proceed to get your Client ID
Configure just received Client ID in Obsidian Imgur plugin settings1.
After creation, Client ID can be managed at: https://imgur.com/account/settings/apps
Authenticated upload
Go to plugin's settings, select 'Authenticated Imgur upload' and complete authentication. That's all! Now you are ready to make notes and upload all your images remotely. You will see all your uploaded images at https://your_login.imgur.com/all/
Anonymous upload
You might not want to see your Obsidian images tied to Imgur account.
For this case there is an 'Anonymous Imgur upload' option.
FAQ
Q: How secure this approach is?
A: Nobody sees your uploaded image unless you share a link or someone magically guesses an URL to your image.
Q: Can I remove a remote image uploaded by accident?
A: For authenticated uploads - yes, go to https://your_login.imgur.com/all/,
for anonymous uploads - no
(it is technically possible, but you will need a deleteHash
which is not recorded. I would record it, but there is no place for logging in Obsidian yet)
Q: For how long an image stays at imgur.com? Is there a chance to lose the data?
A: For authenticated uploads, I guess they are never deleted. What about anonymous uploads?
Earlier it was stated on Imgur website that the image you upload stays forever.
I think this is true since 2015. Today I could not find this statement on Imgur website.
I can assume that images that did not receive any view for years, can be removed, but there is nothing to worry about.
You can read my detailed thoughts on this in discussions
Q: Imgur supports videos. Does the plugin support videos upload?
A: No. Initially, I did not consider videos upload support since there is no Markdown syntax to embed videos.
On the other hand, you can simply use <video>
HTML tag, so I will probably add support for videos in future
Q: Can it upload images to some other service?
A: For now, there are no plans to support other image hosting solutions,
but it should not be difficult for you to make a fork and create your own implementation of ImageUploader
interface.
Discussion
If you have any questions/suggestions, consider using GitHub Discussions. There is also a plugin's thread on Obsidian forum.
Known limitations
- you can not paste animated gifs from the clipboard (they initially get copied as a static images to the clipboard). Use drag and drop instead if you want to upload an animated gif.
- there are daily limits for using Imgur API using associated with particular Client ID.
Known issues
- Sometimes Imgur can reject your request to upload an image for no obvious reason. The error usually reported in this case is a failed CORS request, which does not allow Obsidian to proceed with image upload. If you face this problem, no action required from your side: just wait, and it will disappear soon. Whenever the plugin fails to upload an image remotely, it will fall back to the default method of storing an image locally.
Contribution
Contributions are welcomed. Check out the DEVELOPMENT.md to get started with the code.
Your support
If this plugin is helpful to you, you can show your ❤️ by giving it a star ⭐️ on GitHub. You can also buy me a coffee using Ko-fi:
Footnotes
-
You will only need to configure Client ID in Imgur plugin settings, secret is not required. ↩