Jump to content

How does Evernote map the image resources in .enex file?


Go to solution Solved by eric99,

Recommended Posts

Below is an image of the source code of an .enex file. The note has two local images. The <en-media> tag uses a hash code as the "url" for each local image.

Do you experts know how EN  maps a hash code to the image resource? In other words, if I generate an .enex file from my resources, how can I generate a hash code as the "url" to the local image resource?

Thank you!

Link to comment
  • Solution
41 minutes ago, actant said:

Below is an image of the source code of an .enex file. The note has two local images. The <en-media> tag uses a hash code as the "url" for each local image.

Do you experts know how EN  map a hash code to the image resource? In other words, if I generate an .enex file from my resources, how can I generate a hash code as the "url" to the local image resource?

image.png.c2a6049a338321037c5757b885475bbc.png

Thank you!

"...Those inline images are CDATA encoded base64 strings. They don’t include a hash, but I figured out that decoding the base64 string and then running it through MD5 generates the hash that is used in the corresponding <en-media> tag..."  https://simonwillison.net/2020/Oct/16/building-evernote-sqlite-exporter/

So, as I read this, it's a MD5 calculation on the raw image data.

  • Like 1
Link to comment
  • Evernote Expert

The local copy of the data file - image in your example - has a similarly numbered filename but lacking the file suffix.

So I have a PDF file in one of the directories in the form 004471xc########################

It sits in the resource-cache\User123456\004471xc-####-####-####-############

If I want to open that outside Evernote then I need to copy that and add the appropriate file suffix so that it will open in a file viewer.

Do tell us what you are hoping to achieve and it may be that we can give a more useful response.

Link to comment
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...