chew-z / Escape-Evernote

Tool for escaping from Evernote to freedom of markdown files
MIT License
0 stars 0 forks source link

Handling attachments (embedded images) where no recoIndex meta-data exists #1

Open Analect opened 7 years ago

Analect commented 7 years ago

@chew-z Thanks for this tool. I started to experiment with it, but hit a few stumbling blocks. I'm mostly interested in how it is handling notes with embedded attachments ... as per the "Pierwsze kroki z Evernote Clearly | Evernote" note in your Test.enex file.

Running parse_enex.py with default settings (against Test.enex), it correctly generates 7 files in the /attachments folder. When I ran it against my own test note that happens to have 26 embedded images (attachments), it only captured two of them.

On further inspection, it seemed to only work on images with recoIndex meta-data, which exists for all seven images in the Test.enex file, but was only available for two images in my test file. I'm not altogether sure why evernote would run recoIndex on just two of my 26 images, especially given that they are coming mainly from the same source ... either a PNG image from the Windows Snipping Tool (see below) or alternatively an image from mspaint.exe .. the other common Windows imaging tool.

image

It seems without recoIndex meta-data against all images, one needs to rely on managing the order of the occurrence of hashes (marking the location of an image) with the order of <resource></resource> tags within an enex file and somehow handle these purely based on their ordering.

<en-media hash="4cb9c966346abdeba5458c5036d630b5" style="height: auto;" type="image/png"/></div><div><br/></div><div>These are the configuration settings used to start the program...&nbsp;</div><div><br/></div><div><en-media hash="2a58f35466b3e5816b02c0648717a02d" style="height: auto;" type="image/png"/>

I was wondering if your code can be tweaked in any way to handle the absence of recoIndex meta-data and also, would you have some guidance on handling the placement of markdown images/attachments in-place, rather than just appending to the end of the file. I know you have that as a 'to-do' item and I was just interested in how you were thinking about solving that.

Thanks again for your insights.

chew-z commented 7 years ago

I am sorry for the late answer. My Macbook had been with Apple service for a week and now I am travelling. I will look into this as soon as possible.

I think it is possible what you are asking and I think (not sure) that this logic was part of origial Ian Mortiner code and I skiped this logic as in my case images coud be attached at the end on a note.

Perhaps you could try and example file on original code and see if this is what you are looking for? And I will get back as soon as I am in some place where I can focus for a few hours.