View Single Post
Old 11-20-2010, 01:41 PM   #9
RAH
Guru
RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.RAH ought to be getting tired of karma fortunes by now.
 
RAH's Avatar
 
Posts: 615
Karma: 575652
Join Date: Oct 2010
Location: Hampton, NH
Device: Kobo Aura H20; Kobo ClaraBW
I just want to add to this thread the reasons that have been found why my conversion of this epub file to other formats was not working correctly.

I opened a Calibre bug ticket about this problem (ticket #7469), using essentially the same description about the problem I reported here, and attaching the epub and mobi files.

Turns out that there was a problem in the content.opf file contained in the epub file. From what I understand, this file is the Table of Contents file. Although the TOC appeared correct when the epub file was viewed in a reader, and when it was viewed in the Sigil TOC tool, there was an incorrect line in it in the <guide> area of the content file, appearing as this:

<guide>
<reference type="cover" title="Cover" href="Text/Choose_note3.xhtml"/>
</guide>

This line was apparently generated by Sigil at some point during my editing of the epub file. It is incorrectly pointing to the page Choose_note3.xhtml as the "Cover".

I did have trouble while working on the epub file getting the cover to display correctly on my Nook, so probably some of my manipulations caused this bogus line to be placed in the TOC file. Looking on the Sigil forum, apparently the Symantics menu is what is used to manipulate this <guide> data, but while trying to correct the cover problem I only knew about the Symantics menu in relation to the cover.jpg file, which I did assign a Symantics of "Cover Image", which made it work correctly as a cover.

Although the <guide> error did not affect the display of the cover or the display of the Choose_note3 page in any viewer, it did cause Calibre to drop that Choose_note3 page from the conversion to any other format (or at least the ones I tried, mobi and pdf).

Fortunately, kovidgoyal was savvy enough to look inside the epub archive and spot the offending <guide> lines in the content.opf file. He added this info to the report thread and that was the resolution - a problem with the file, not Calibre, which is not surprising but very hard to find (at least for me).

I have fixed the problem by reading some on the Sigil forum, renaming the .epub file to .zip, extracting the content.opf file from it, editing it and removing those bad lines and inserting instead several innocuous <guide> lines like this:

<guide>
<reference type="cover" title="Cover" href="Text/Cover.xhtml"/>
<reference type="title-page" title="Title Page" href="Text/Title.xhtml" />
</guide>

After replacing this file back into the zip file and renaming it back to epub, it now converts correctly into the mobi file I was trying to create.

Having read some more in the Sigil doc, I probably could have used the Symantics menu on the Choose_note3 page to fix the <guide> error (there are a bunch of choices when you right-mouse a .xhtml file in Sigil and look in the Symantics menu), instead of doing it the brute-force way I did by manipulating the archive.

Anyway, all's swell that ends swell. I think that this <guide> area is not mentioned much with regard to these files, and since it can in fact mess you up somewhat, I thought it might help some people later to know that they should pay attention to it, and the format of the content.opf file itself. Apparently the Sigil folks have plans to allow direct editing of this file in the future, which would be a big help.
RAH is offline   Reply With Quote