Home / GitHub Page

Embed remote images

Many of my imported Evernote images are loaded from remote URLs, which is not sustainable as long-term achive. It would be useful to have a function for embedding all (or selected) external images.

I don’t see that being part of the main app, but it could be done relatively easily with a script that would process all the notes, and swap the image URLs with a resource ID.

Yes, I’d also like that. How could it be done?
I’m not sure how the script is supposed to store the image from an URL into a resource and get its ID - I don’t see that in the API docs.

Also, why don’t you think it’s a good fit for the app itself? Considering how popular the scraper is, I’d think making local copies of images would be in demand. (I’m not saying it is - I’m probably biased here.)

The script would do something like this:

  • Get all notes
  • Parse each note and extract the image URLs
  • For each image URL, download the image
  • Create a resource from the image using POST /resources
  • Swap the image URL with the resource ID

In Joplin, normally there’s nothing that allows inserting an image URL. If you paste an image, it creates a resource, if you import an image, it makes a resource. If you clip a web page, it converts all the images to resources. The only case there can image URLs I guess is if if imported Evernotes notes had links to external images (normally they are all embedded images which are also converted to resources), so that’s why it’s a bit of an edge case, so making it part of the main app should not be necessary.

Actually @cloo, do you have an example of ENEX file with these external image URLs? Maybe what should be done is convert these to resources on import.