kubo / snzip

Snzip, a compression/decompression tool based on snappy
Other
216 stars 30 forks source link

add support for Apple iWork .iwa files #14

Closed teppo-localeyes closed 8 years ago

teppo-localeyes commented 8 years ago

Could you please add support for Apple iWork .iwa files. These are in Snappy's framing format but slightly non-standard. There is documentation available here:

https://github.com/obriensp/iWorkFileFormat/blob/master/Docs/index.md#snappy-compression

teppo-localeyes commented 8 years ago

Here is a sample file.

Document.iwa.zip

kubo commented 8 years ago

I'll add it at the next weekend. File format detection will not be supported because the iwa format has no file signature. -t iwa option is required to compress/uncompress files.

kubo commented 8 years ago

Sorry. I had forgot it. I did it just now. (bcf1150) I tested it with the file you attached.

$ unzip Document.iwa.zip
$ cp Document.iwa Document.iwa.bak
$ snzip -t iwa -d Document.iwa       # uncompress Document.iwa
$ snzip -t iwa Document              # compress Document and create Document.iwa
$ cmp Document.iwa Document.iwa.bak  # verify whether snzip makes same contents.

Could you test it with an iwa file whose length is larger than 65536? The maximum length of uncompressed data in a chunk is 65536 in snappy-framed format. See: https://github.com/google/snappy/blob/1.1.3/framing_format.txt#L90-L92 However I'm not sure that it is same with the iwa format.

teppo-localeyes commented 8 years ago

Works great even with files larger than 65536. Thanks!

davejacobs commented 8 years ago

I'm getting Unknown file format name iwa. Is there an extra step I need to do?

I'm using snzip 1.0.3 and snappy 1.1.3.

davejacobs commented 8 years ago

Ah I see, it's not out yet. Would you mind cutting a release when you get a chance, @kubo? (This is really great!)

kubo commented 8 years ago

@davejacobs I'll make a new release next weekend.

davejacobs commented 8 years ago

Okay, thanks! I look forward to trying it out.

kubo commented 8 years ago

@davejacobs snzip 1.0.4 was released.

davejacobs commented 8 years ago

Thanks! 🎉

svpv commented 8 years ago

Would you please tag the release?

golanlevin commented 6 years ago

This saved my butt, and helped me recover my mom's memoirs. Thanks for the .iwa compatibility.

codecowboy commented 1 year ago

@golanlevin @teppo-localeyes What are the steps to get an iwa into a human readable format or XML if extraction results in a protobuf stream? Is it possible to end up with XML after doing:

snzip -t iwa -d Document.iwa
//what next?

My understanding is that iwa fies are XML files which are converted to protobuf streams and then compressed using snappy. Is it possible to recover the original XML? I've never used protobuf or snappy and installed snzip using brew. Am on MacOS Ventura 13.4 (Apple Silicon)