View Single Post
Old 03-28-2011, 06:22 PM   #21
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by kiwidude View Post
...Right now I know absolutely zero about the internals of an ePUB in terms of detecting a Calibre jacket but I'm sure if I looked into it or asked in the dev forum someone could give me a pointer. I know how to get the EPUB content (having done that for the Extract ISBN plugin), what I don't know is how to use that set of internal EPUB files to identify a jacket being amongst them. Perhaps there is a simple regex I can apply or similar. If anyone throws the answer at me I will add this sooner, otherwise I will put it on the list for a future release.
Some ideas:
  • First find the .opf file.

    and then:
  • Find the <spine> section and search for (part of)
    Code:
    <itemref idref="calibre_jacket"/>
    or
  • find the <manifest> section and search for (part of):
    Code:
    <item href="jacket.xhtml" id="calibre_jacket" media-type="application/xhtml+xml"/>
    or maybe
  • look for jacket.xhtml as one of the content files inside the epub although I suppose it's possible this name may not be uniquely specific to calibre.
jackie_w is offline   Reply With Quote