05-01-2010, 12:47 PM | #1 |
Junior Member
Posts: 7
Karma: 42
Join Date: May 2010
Device: iPod; iPad
|
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? |
05-01-2010, 03:38 PM | #2 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
The mimetype has to be packed first and uncompressed.
|
Advert | |
|
05-01-2010, 04:15 PM | #3 |
Junior Member
Posts: 7
Karma: 42
Join Date: May 2010
Device: iPod; iPad
|
|
05-01-2010, 06:25 PM | #4 |
Booklegger
Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
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... |
05-01-2010, 07:45 PM | #5 | |
Junior Member
Posts: 7
Karma: 42
Join Date: May 2010
Device: iPod; iPad
|
Thank you. This removes the original error, but now results in:
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:
Last edited by macdafydd; 05-01-2010 at 08:10 PM. Reason: added info |
|
Advert | |
|
05-02-2010, 04:52 AM | #6 | ||
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
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:
|
||
05-02-2010, 05:47 AM | #7 |
Junior Member
Posts: 7
Karma: 42
Join Date: May 2010
Device: iPod; iPad
|
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. |
05-02-2010, 02:04 PM | #8 |
Booklegger
Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
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 |
11-23-2010, 07:46 PM | #9 |
eBook Designer
Posts: 26
Karma: 10
Join Date: Jun 2010
Location: New Jersey
Device: ipad, nook, kindle
|
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 |
11-24-2010, 03:47 AM | #10 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You can also add the files to Sigil and then save of course...
|
11-26-2010, 11:04 AM | #11 |
eBook Designer
Posts: 26
Karma: 10
Join Date: Jun 2010
Location: New Jersey
Device: ipad, nook, kindle
|
Thanks, Toxaris! : )
|
11-28-2010, 07:51 PM | #12 |
Media Bloke
Posts: 2,381
Karma: 113956855
Join Date: Sep 2010
Location: NSW - Australia
Device: iOS
|
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 |
11-28-2010, 08:47 PM | #13 |
Addict
Posts: 351
Karma: 70000
Join Date: Jul 2010
Location: Australia
Device: ADE, iPad
|
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... |
11-28-2010, 08:57 PM | #14 |
Media Bloke
Posts: 2,381
Karma: 113956855
Join Date: Sep 2010
Location: NSW - Australia
Device: iOS
|
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? |
11-28-2010, 09:07 PM | #15 | |
Addict
Posts: 351
Karma: 70000
Join Date: Jul 2010
Location: Australia
Device: ADE, iPad
|
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 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What's this validation error and how to fix it. | Adjust | ePub | 9 | 06-28-2011 10:45 PM |
epub validation error | sassanik | Sigil | 19 | 12-08-2010 05:46 AM |
ePub validation error | sk19.gupta | Introduce Yourself | 6 | 10-19-2010 10:53 PM |
Validation error | rrosenwald | Calibre | 10 | 10-01-2010 11:12 AM |
Validation error new with Calibre 0.7.6 | JrBashi | Calibre | 7 | 06-28-2010 09:56 PM |