View Single Post
Old 11-07-2010, 03:01 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,494
Karma: 28005164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The OPF specification has no defined way of specifying a cover. A guide element specifying the cover is purely optional and no reading system is required to follow it. Nor are its semantics defined in any unambiguous way.

What you are asking for is that when a zip file is added to calibre, calibre should look inside the ZIP, read the OPF and then open and read the cover. No specification mandates this behavior for ZIP files.

And just to illustrate the complexities of doing something like this, there at least 3 common ways an OPF inside a ZIP file can specify a cover:

1) A <meta> element of type 'cover' that points to the id of the cover image in the manifest

2) A <guide> element as you described

3) Expecting the reading system to render the first element in the spine and using the first 'screenful' of that as the cover.

EPUB for example (which is just an OPF in a ZIP file) uses a mix of all three of those strategies.

The last time I checked kindlegen supports only the second.

I haven't bothered to implement that complexity when importing ZIP files as frankly I have no idea why anyone would go to the trouble of creating a ZIP file with an OPF and not just make it an EPUB.

When dealing with EPUB, calibre supports all 3 strategies. So I would suggest you make an epub of your zip file and import that to calibre.
kovidgoyal is offline   Reply With Quote