Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 05-01-2010, 12:47 PM   #1
macdafydd
Junior Member
macdafydd began at the beginning.
 
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?
macdafydd is offline   Reply With Quote
Old 05-01-2010, 03:38 PM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,014
Karma: 3618999
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
The mimetype has to be packed first and uncompressed.
Toxaris is offline   Reply With Quote
 
Enthusiast
Old 05-01-2010, 04:15 PM   #3
macdafydd
Junior Member
macdafydd began at the beginning.
 
Posts: 7
Karma: 42
Join Date: May 2010
Device: iPod; iPad
Quote:
Originally Posted by Toxaris View Post
The mimetype has to be packed first and uncompressed.
And how can I do this, please?
macdafydd is offline   Reply With Quote
Old 05-01-2010, 06:25 PM   #4
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
Posts: 1,799
Karma: 7999034
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...
pholy is offline   Reply With Quote
Old 05-01-2010, 07:45 PM   #5
macdafydd
Junior Member
macdafydd began at the beginning.
 
Posts: 7
Karma: 42
Join Date: May 2010
Device: iPod; iPad
Quote:
Originally Posted by pholy View Post
You just have to run zip twice..
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:
<?xml version="1.0" ?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:conta iner">
<rootfiles>
<rootfile full-path="content.opf" media-type="application/oebps-package+xml"/>
</rootfiles>
</container>
The full folder structure can be seen at http://perso.orange.es/nealegeorge/pics/ROE.png

Last edited by macdafydd; 05-01-2010 at 08:10 PM. Reason: added info
macdafydd is offline   Reply With Quote
Old 05-02-2010, 04:52 AM   #6
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,014
Karma: 3618999
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
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:
<?xml version="1.0" ?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:conta iner">
<rootfiles>
<rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
</rootfiles>
</container>
You can of course omit the folder structure in the OEBPS folder and put everything in the root of OEBPS.

You're zip command would then be:
Quote:
zip -DX0 ROE.epub mimetype
zip -DrX9 ROE.epub META_INF OEBPS
Good Luck.
Toxaris is offline   Reply With Quote
Old 05-02-2010, 05:47 AM   #7
macdafydd
Junior Member
macdafydd began at the beginning.
 
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.
macdafydd is offline   Reply With Quote
Old 05-02-2010, 02:04 PM   #8
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
Posts: 1,799
Karma: 7999034
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
pholy is offline   Reply With Quote
Old 11-23-2010, 07:46 PM   #9
sueneu
eBook Designer
sueneu began at the beginning.
 
sueneu's Avatar
 
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
sueneu is offline   Reply With Quote
Old 11-24-2010, 03:47 AM   #10
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 3,014
Karma: 3618999
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
You can also add the files to Sigil and then save of course...
Toxaris is offline   Reply With Quote
Old 11-26-2010, 11:04 AM   #11
sueneu
eBook Designer
sueneu began at the beginning.
 
sueneu's Avatar
 
Posts: 26
Karma: 10
Join Date: Jun 2010
Location: New Jersey
Device: ipad, nook, kindle
Thanks, Toxaris! : )
sueneu is offline   Reply With Quote
Old 11-28-2010, 07:51 PM   #12
wannabee
Media Bloke
wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.
 
Posts: 2,377
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
wannabee is offline   Reply With Quote
Old 11-28-2010, 08:47 PM   #13
Adjust
Addict
Adjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel is
 
Adjust's Avatar
 
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
http://www.mobileread.com/forums/sho...t=epub+zip+mac

I've used since I started making them, without any issues...
Adjust is offline   Reply With Quote
Old 11-28-2010, 08:57 PM   #14
wannabee
Media Bloke
wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.
 
Posts: 2,377
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?
wannabee is offline   Reply With Quote
Old 11-28-2010, 09:07 PM   #15
Adjust
Addict
Adjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel is
 
Adjust's Avatar
 
Posts: 351
Karma: 70000
Join Date: Jul 2010
Location: Australia
Device: ADE, iPad
Quote:
Originally Posted by wannabee View Post
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?
I dunno about PC's
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
Adjust is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 08:06 PM.


MobileRead.com is a privately owned, operated and funded community.