keynote-parser icon indicating copy to clipboard operation
keynote-parser copied to clipboard

Ls command does not list files in Indexand Cannot dump iwa following usage instructions

Open v1nce opened this issue 4 years ago • 3 comments

Hi,

I don't get it. Isn't the ls command supposed to list the *.iwa in Index ?

Here is what I get when I run keynote-parser ls foo.key (foo.key is a keynote presentation file = compressed file)

TestPresentation.key/Data/143917994_2881x1992-small-4.jpg and other jpeg ... TestPresentation.key/Index.zip ... TestPresentation.key/Metadata/BuildVersionHistory.plist and other plist ... TestPresentation.key/preview-micro.jpg TestPresentation.key/preview-web.jpg TestPresentation.key/preview.jpg

One can see that the Index branch was not "opened" to display its content. You only see "Index.zip" I didn't expect the internal path to be that complex. Instead of TestPresentation.key/preview.jpg I only expected preview.jpg

Anyway, I unpacked foo : keynote-parser unpack foo.key I get a "foo" dir. Inside I found a dir named "TestPresentation.key" And inside it I found the expected files (as listed by ls). But the Index is still zipped ("Index.zip") unzip Index.zip => got a Index dir where my slides are named SlideX.iwa (and not Slide-0000X.iwa like in your doc)

I move up to my root directory and run the following commands keynote-parser cat foo.key /Index/Slide1.iwa
keynote-parser cat foo.key TestPresentation.key/Index/Slide1.iwa
keynote-parser cat foo.key foo/TestPresentation.key/Index/Slide1.iwa
I got no error message but no output either.

I tried other combinations on the archived file or the uncompressed dir with no luck (no output or error messages about isdirectory or isafile)

I finally find the good command which is quite different of what is described in usage Instead of # Dump a particular .iwa file into its yaml representation on stdout keynote-parser cat MyPresentation.key /Index/Slide-00001.iwa

I did the following keynote-parser cat foo TestPresentation.key/Index/Slide1.iwa

So I needed to : keynote-parser unpack, then unpack Index.zip to know how the iwa were named keynote-parser ls foo.key to get the full "internal" path names made an educated guess that I need to cat the output dir of the unpack command

I should be missing something.

v1nce avatar May 14 '21 12:05 v1nce

Hi! The output you've provided is quite different from what I get when running ls on a .key file - for instance, with the emoji-oneslide.key in the tests of this repo, I get:

> keynote-parser ls tests/data/emoji-oneslide.key
Data/...
Index/AnnotationAuthorStorage.iwa
Index/CalculationEngine.iwa
Index/Document.iwa
Index/DocumentMetadata.iwa
Index/DocumentStylesheet.iwa
Index/MasterSlide-7880.iwa
Index/MasterSlide-7900.iwa
Index/MasterSlide-7915.iwa
Index/MasterSlide-7928.iwa
Index/MasterSlide-7942.iwa
Index/MasterSlide-7956.iwa
Index/MasterSlide-7968.iwa
Index/MasterSlide-7985.iwa
Index/MasterSlide-7997.iwa
Index/MasterSlide-8015.iwa
Index/MasterSlide-8034.iwa
Index/MasterSlide-8048.iwa
Index/Metadata.iwa
Index/Slide-8060.iwa
Index/ViewState.iwa
Metadata/BuildVersionHistory.plist
Metadata/DocumentIdentifier
Metadata/Properties.plist
preview-micro.jpg
preview-web.jpg
preview.jpg

Are you able to provide an example Keynote file? It's possible that the file you're using was saved with a much older version of Keynote that this tool was not tested on.

psobot avatar May 14 '21 16:05 psobot

Hi,

I don't know if I'm allowed to attach the file here but it's probably fine to give its url : https://www.dan.info/sampledata/iwork/TestPresentation.key.zip

I downloaded the file to temp then remove zip extension and run ls command on it.

v1nce avatar May 17 '21 10:05 v1nce

I tried one of your sample ant it is working ok.

Structure of my key is different from yours. I don't have a mac right now to check if my file opens ok in keynote. But I looked if the Index.zip was a packing error affecting only my example. And I found some discussions that mentions it. So it seems legit. https://stackoverflow.com/questions/24768500/manually-rebuild-a-key-keynote-file-from-components

After further digging it looks like you're right about my key being in another version of the key file http://fileformats.archiveteam.org/wiki/Keynote The basic file format is consistent across the iWork suite, and is documented more fully in the iWork article. In the 2013 version of the format, the different apps mostly differ in what IWA files are stored in the Index.zip file (a ZIP within the bundle).

v1nce avatar May 17 '21 16:05 v1nce