Jump to content

Does anyone know the format specification for image data in the ENEX file?


Recommended Posts

I'm writing a program that will port data from an old journal into Evernote.

The old journal exports its data in RTF and RTFD files, the former is text-only, the latter is text with images that I will resolve to jpeg's.

My program can easily convert the RTF files to ENEX's XML schema.

However, I need to know what the format spec is for images in ENEX's XML schema so I can convert my jpeg's to it.

Is this image specification documented somewhere and, if so, would you please point me to it.

Thank you very much,

Jay

  • Like 1
Link to comment
11 hours ago, JLS99 said:

I'm writing a program that will port data from an old journal into Evernote.

The old journal exports its data in RTF and RTFD files, the former is text-only, the latter is text with images that I will resolve to jpeg's.

My program can easily convert the RTF files to ENEX's XML schema.

However, I need to know what the format spec is for images in ENEX's XML schema so I can convert my jpeg's to it.

Is this image specification documented somewhere and, if so, would you please point me to it.

Thank you very much,

Jay

The implementation is straight forward: as you know XML is in UTF8 format (ASCII superset), therefore the binary data should be converted to text by base64 encoding, for the meta data see below:

"...For each resource contained in the note, there will be a corresponding resource element within note which will be comprised of the following child elements:

  • data is a base64-encoded version of the Resource.
  • mime is the MIME type of the Resource.
  • width and height will be set if the Resource can be displayed inline (e.g., images and PDFs)..."
  •  

see : https://evernote.com/blog/how-evernotes-xml-export-format-works/

base64 encoders are available in every language, here is one for python: https://docs.python.org/3/library/base64.html

 

  • Like 1
Link to comment

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...