imessage-exporter icon indicating copy to clipboard operation
imessage-exporter copied to clipboard

[Request] Adjust attachment creation/modification date to iMessage timestamp

Open mbaran5 opened this issue 2 years ago • 9 comments

This would be a super helpful way to possibly organize/consume the attachments. If you took the date/time from the message it was sent/received with and tagged that to the photo. I could find all photos sent/received in April 2019 for example if they had date stamps instead of just the day that they're all defaulted to.

mbaran5 avatar Jan 16 '23 23:01 mbaran5

Right now they get the timestamp they are copied by the exporter. I assume that file metadata is platform-specific, so this ticket requires some investigation. I think it is a useful feature to have.

For HEIC/HEIF conversion I am not sure if we can do anything here since we are creating entirely new files.

ReagentX avatar Jan 16 '23 23:01 ReagentX

Mine are all being stamped either the day I setup my current Mac, or some day in November but unsure why. Maybe the last time I set up a new iPhone?

that said, couldn’t you just adjust the file system date/time with whatever the message timestamp is? I know there’s probably a faster way but ‘touch -t’ lets you adjust any files create date.

Thanks! This is awesome software.

mbaran5 avatar Jan 16 '23 23:01 mbaran5

touch -t is platform-specific, imessage-exporter needs something more generic than that. This library might be the solution.

ReagentX avatar Jan 16 '23 23:01 ReagentX

This could be tricky as I think attachments are deduplicated and can be referenced by multiple messages of different dates. For example:

$ grep -r 'Library/Messages/Attachments' ./message-export/txt/ | sed 's/.*\.txt://' | wc -l
26523
$ grep -r 'Library/Messages/Attachments' ./message-export/txt/ | sed 's/.*\.txt://' | sort -u | wc -l
18454

I have an alternate idea that might help organize attachments: #79

edit: my numbers up there might be wrong. I'm re-exporting to a different directory to check, but I think the deduplication part at least is correct.

fracai avatar Jan 20 '23 04:01 fracai

I’ve noticed in my export that media isn’t deduplicated. I have several copies of the same video (exact same byte size) but with different names.

27DD2814-1B7F-4F84-A154-6546513D2C52

mbaran5 avatar Jan 20 '23 04:01 mbaran5

If you see the same attachment multiple times, it means it was included in multiple conversations. Every time imessage-exporter sees a message with an attachment, it makes a copy.

@fracai This ticket is about preserving file metadata, not directory structure.

ReagentX avatar Jan 20 '23 04:01 ReagentX

This was my assumption as well. Doesn’t that then invalidate @fracai post?

Apologies on the close/open - fat finger.

mbaran5 avatar Jan 20 '23 04:01 mbaran5

@fracai This ticket is about preserving file metadata, not directory structure.

Fair enough

fracai avatar Jan 20 '23 04:01 fracai

This was my assumption as well. Doesn’t that then invalidate @fracai post?

It's very possible I misinterpreted the grep results that I saw. I'm running another export to clear that up and I'll update my comments in my other ticket.

fracai avatar Jan 20 '23 04:01 fracai