No description
Find a file
2024-10-30 02:54:00 +03:00
.github ci: extract Sonar scan to a seprate job 2024-10-21 14:58:12 +03:00
.husky chore: migrate to Husky v9 2024-03-31 01:12:06 +03:00
.vscode Formatting with Prettier for the project 2021-07-09 03:03:11 +03:00
scripts build: refactor build setup to develop without 'obsidian-plugin-cli' 2024-08-24 09:08:52 +03:00
src style: apply stylistic type-checked rules from typescript-eslint 2024-10-21 00:52:50 +03:00
test test(e2e): add test for resizing image with command palette 2024-10-30 02:22:45 +03:00
.commitlintrc.yaml chore: switch to yaml for configuring prettier and commitlint 2023-05-04 17:45:00 +03:00
.editorconfig chore(prettier): from default 80 line length to airbnb's conventional 100 2023-05-05 00:59:13 +03:00
.git-blame-ignore-revs chore: update .git-blame-ignore-revs 2024-10-21 00:55:12 +03:00
.gitignore chore(git): ignore lock-files from popular package managers 2024-10-21 16:13:38 +03:00
.prettierignore Wow, many rules, very strict, such consistency 2021-07-01 02:48:44 +03:00
.prettierrc.yaml style: apply new prettier rules to the whole project 2023-05-05 00:59:13 +03:00
CHANGELOG.md 2.0.0 changelog 2021-07-12 23:56:33 +03:00
DEVELOPMENT.md build: refactor build setup to develop without 'obsidian-plugin-cli' 2024-08-24 09:08:52 +03:00
eslint.config.js style: apply stylistic type-checked rules from typescript-eslint 2024-10-21 00:52:50 +03:00
LICENSE 1.0.0 2021-01-15 00:37:57 +03:00
manifest.json chore: 2.6.2 release 2024-10-07 23:38:23 +03:00
package.json build: explicitly declare types used by TypeScript compiler for wdio tests 2024-10-30 02:54:00 +03:00
README.md docs: refresh docs to highlight the importance of Client ID 2024-07-25 13:06:34 +03:00
sonar-project.properties ci: perform sonar scan with CI 2022-05-18 23:43:34 +03:00
tsconfig.json refactor: switch to for-of loops where possible 2024-10-21 00:47:34 +03:00
versions.json chore: 2.6.2 release 2024-10-07 23:38:23 +03:00
vitest.config.ts build: update all project dependencies 2023-10-12 07:52:30 +03:00

Obsidian Imgur Plugin

Maintainability Rating Installations count

This plugin uploads images to imgur.com instead of storing them locally in your vault.

obsidian-imgur-plugin-demo

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

Santi Younger - Use Images Like A Pro

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:

  1. If you do not have an Imgur account, you need to get one first - follow https://imgur.com/register
  2. Being authenticated, go to https://api.imgur.com/oauth2/addclient
  3. Use any name for "Application name". For example: "Obsidian Imgur plugin"
  4. Choose "OAuth 2 authorization with a callback URL"
  5. Important: use obsidian://imgur-oauth as an "Authorization callback URL" value
  6. 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:

ko-fi


  1. You will only need to configure Client ID in Imgur plugin settings, secret is not required. ↩︎