View Single Post
Old 09-12-2008, 10:34 AM   #5
salty-horse
Enthusiast
salty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametersalty-horse can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
salty-horse's Avatar
 
Posts: 29
Karma: 12830
Join Date: Sep 2008
Device: Sony PRS-T1
Info-Zip actually checks if the "deflate" algorithm will reduce the file size. In the case of the mimetype file, it's too small for the algorithm to be efficient, so no compression is done.

It also removes duplicates from the file list (such as the case of "mimetype *"), and zips the files by order.

All of those form a very nice trick.

HOWEVER (and I just figured this out), this creates a non-standard epub file.

The specification states:

http://www.idpf.org/ocf/ocf1.0/download/ocf10.htm

Quote:
The [mimetype] file MUST be neither compressed nor encrypted and there MUST NOT be an extra field in its ZIP header.
By default, zip adds "extra file attributes". This prevent the text 'application/epub+zip' from being located in byte 38 in the epub file.

The original in my post used the -X flag on the mimetype. That flag strips away the headers, and is what required by the spec.

BTW, the commands were given to me by Hadrien Gardeur. I claim no credit.
salty-horse is offline   Reply With Quote