imessage-exporter
imessage-exporter copied to clipboard
[BUG] no image attachements in html format
When generating an archive with HTML files the images don't appear into the conversation. But an attachements directory is correctly created in file structure<;
Tried on intel mac. Golden master binary and cloned repo at current state.
Do the filepaths in the HTML work if you go to them directly?
When opening a generated html file on safari, brave or even opera. (so we can safely say all browsers) a path such as: file:///Users/cedricloneux/Downloads/messages/<PHONE_NUMBER>.html
the images are not shown but <img>
tags are in the HTML file. A bit of debugging and I got images working using absolute path instead of relative path.
How did you change the paths to get this working?
As I said, I manually changed the image path from relative to absolute. Meaning complete path from root directly /
~~Ok, so the broken paths had a ~
prefixing them? If so, I need to add some code to expand that. If it wasn't a ~
, what were they relative to?~~
I understand the issue, right now imessage-exporter
drops attachments in the specified output directory, which when set manually is relative to the working directory the program was launched in. To improve compatibility this path should get expanded.
https://github.com/ReagentX/imessage-exporter/blob/c5006a30e7d7b71e5873bef551724a3ab3ac7dac/imessage-exporter/src/exporters/html.rs#L390-L392
Shouldn't this actually use the relative path, so that the archive can be stored elsewhere and viewed? I took a full db dump from my mac and moved it to my NAS, but none of my conversations work because each image is <source src="/Users/user.name/imessage_export/attachments/fccb2309-9b2e-4bd9-9ef6-cc5d19baceab.mov"...>
Wouldn't it make sense to just look one level up so as long as /attachments is in the directory of the html files, images can be viewed?
That sounds reasonable, I will implement that going forward.
I can confirm this works as well. Adjusting the path to just attachments/... allows the file to be read with photos and videos from another PC via the network. I modified a small conversation of mine.
Thank you for the suggestion!