View Single Post
Old 08-01-2013, 11:42 PM   #30
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by grumbles View Post
The key issue with the mimetype file is that it must be the first file and it must be added as stored, not compressed. The easiest way to do this is with the command line (info)zip program. Create the file first by adding the mimetype file with compression 0 (store). Then append all the other files to this zip file with the compression factor of your choice. But the mimetype, must be the first file and it must be stored. I don't know if using WinRAR or other programs will maintain the position of the mimetype as the first. The infozip program does.

I've been planning on writing a program to specifically zip up a directory tree into an epub file. I'll get to it real soon now. I just need to find a cross-pltform zip library for Free Pascal. As I said, real soon now.
Yeah, I hear you re: the "real soon now." I've been meaning to write a simple shell script in *nix to do the same, but the commands are so simple:

Code:
$ zip -X0 mybook.epub mimetype
$ zip -Xgr mybook.epub META-INF
$ zip -Xgr mybook.epub OEBPS
that I haven't yet felt the itch strongly enough to scratch it. My fingers do the work, with my conscious brain disengaged. Given that my epubs have that much of a predictable structure.

But if you did make a stand-alone, cross-platform application that could do this, I'm sure it would be a hit.

Of course, the trick might be how to handle non-standard internal structure.

ETA: Oh, and as I understand it, the key to solving the fonts problem, currently, is having a "non-standard" epub to pass to KDP. Just adding this to keep us more-or-less on topic, while hopefully passing useful info for the general case of (re)packing an epub.

Albert

who is possibly the laziest ebook-builder on this forum

Last edited by st_albert; 08-01-2013 at 11:47 PM. Reason: an afterthought.
st_albert is offline   Reply With Quote