![]() |
Error during validation
I have written a script to produce an ebook in epub format from data stored locally.
Upon validation of the epub file, one error is returned: ERROR: ROE.epub: length of first filename in archive must be 8, but was 22 The zip command I used to compress the files was as follows: zip -Xr9D ROE.epub mimetype * .DS_Store (All the files are in place, including mimetype.) Any ideas as to what I am doing wrong? |
The mimetype has to be packed first and uncompressed.
|
Quote:
|
You just have to run zip twice:
zip -DX0 ROE.epub mimetype zip -DrX9 ROE.epub META_INF .DS_Store This assumes all your file are in .DS_STORE -- if you have your files all in the same directory as mimetype, you can't use the * because it will add mimetype in again. You will have to name all the files individually - or maybe use *.xhtml or some such... |
Quote:
ERROR: ROE.epub: Required META-INF/container.xml resource is missing and produces an epub file with rubbish content (even though the individual files have correct content and were displayed correctly in the previously generated epub). The folder in which the files for the ebook are stored does, however contain a folder named META-INF, which itself contains the file container.xml which contains the following text: Quote:
|
Open the epub as a zipfile (no idea how to do this on a Mac) and see if the folder structure in the zipfile is correct. The mimetype should be in the root and also the META-INF should be in the root.
If you used the command Pholy provided, there is a change that the xhtml files itself are not contained. You're wildcard in you're first command made sure that those files where contained. Personally I use the following structure, which helps for me: root --mimetype (file) --META-INF (folder) --OEBPS (folder) --xhtml files --fonts (folder, when used) --css (folder) --images (folder) If you use a folder structure like this, you're container.xml should read: Quote:
You're zip command would then be: Quote:
|
After some searching on the Web, I find that this is the most common problem with generating the epub file.
I have tried several solutions found here and there and have at last found one that actually works, resulting in a validation from http://threepress.org/document/epub-validate/ The following zip commands did the trick: zip -q0X ROE.epub mimetype zip -qXr9D ROE.epub * Hope this will help others. |
Very good, Macdafydd - your two line solution will work for any directory structure - mine assumed all the content files were in .DS_STORE (Where did that come from?). And the reason the * doesn't re-add the mimetype file is that the default action is to 'freshen' an archive - add new files and update changed files - not to copy in all files.
the 'q' simply runs quietly, which is useful if this is done in a script, but normally I like to see what is happening So, thank you for posting your final solution. - K coming your way |
Thanks, MacDafydd, pholy, this pointed me in the right direction(s). I had the same "container.xml resource is missing" error.
Using MacDafydd's terminal code left me with the .DS_Store file in the EPUB package, so this worked for me: zip -q0X Filename.epub mimetype zip -qXr9D Filename.epub META-INF OEBPS -x \*.DS_Store |
You can also add the files to Sigil and then save of course...
|
Thanks, Toxaris! : )
|
So, just when it looks like this thread is done and dusted
I'm confused (don't laugh). I've been right clicking on the folder and selecting send to compressed zip folder from day one. They validate. My process is Export to ADE from InDesign Change file type to zip Extract files Edit Right click folder to compressed zip Change file type to epub Am I missing something here :blink: |
The mimetype file needs to be uncompressed and at the top (from memory)
I use this Applescript https://www.mobileread.com/forums/sho...t=epub+zip+mac I've used since I started making them, without any issues... |
Thank Adjust, I've just save that script to my dropbox for my macs at home.
So how come my epubs validate when I zip them all up together with a right click on the PC? Was it pot luck? |
Quote:
I'm assuming you are not actually extracting the epub, just working from withing the zip... i.e. not clicking on the "extract all" button. There's a PC version of that script getting around here... But I guess you don't need to |
| All times are GMT -4. The time now is 07:58 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.