threeplanetssoftware / apple_cloud_notes_parser

Parser for Apple Notes data stored on the Cloud as seen on Apple handsets
MIT License
411 stars 26 forks source link

com.apple.paper.doc.scan is Unrecognized ZTYPEUTI #86

Closed podviaznikov closed 1 year ago

podviaznikov commented 1 year ago

ZTYPEUTI to add: com.apple.paper.doc.scan

Anticipated type of file: "image"

threeplanetssoftware commented 1 year ago

I'm going to investigate this one a bit. Judging by the type, I suspect it might behave more like a gallery than an image, unless the scans create a gallery full of these objects.

threeplanetssoftware commented 1 year ago

Can you help me understand how this was created? I used the Notes app to scan a document on iOS 17 and that turns into a com.apple.notes.gallery object with individual public.jpeg objects making up the images. Was this from an external app and imported into Notes? Worst case is I can try to treat it like a normal image, but I'd like to make sure that will work first.

threeplanetssoftware commented 1 year ago

Well, I just tossed this in as an image format in f289dc3f88a34536a4acaedafd97b46e51be398b. I still haven't reproduced it myself, can you please verify that it behaves as you are expecting in your data?

mirnovov commented 1 year ago

@threeplanetssoftware I'm working on the Apple Notes importer for Obsidian. I was just doing the scan functionality and had it pop up - from my investigation, it's created when you edit a normal scanned document (com.apple.notes.gallery). From what I can tell it is stored similar to the drawings, with a fallback PDF instead of a fallback image.

Btw thanks for all your work on this, although I haven't used any of it directly apart from your protobuf definition, it's been an invaluable reference.

threeplanetssoftware commented 1 year ago

Thank you, that is EXTREMELY helpful! I'll see if I can mark up something and now recreate this. The fallback PDF is a key difference, appreciate that insight.

threeplanetssoftware commented 1 year ago

This is now solved. There's potentially a new bug with how galleries are created in iOS17, but that's a problem for a separate ticket. Now a scanned document will show the fallback PDF.