Review Request: 4.5 Feature: ePub Book Thumbnailer

Harsh J qwertymaniac at
Fri Mar 12 19:08:23 GMT 2010

This is an automatically generated e-mail. To reply, visit:

(Updated 2010-03-12 19:08:23.673017)

Review request for kdelibs.


Adding the 'Dolphin' group seems to add too many recipients, so removing that.


This feature addition to kdebase aims to provide thumbnails of ePub book covers.

Early-message: This is my first try at XML parsing (I've used the SAX approach), so do give me pointers/tips on doing it better wherever possible :-)

I've written code to:
  * Unpack the ePub (essentially a proper-structured ZIP file).
  * Open and parse the OPF file to find the 'cover page' entry (x/html), done by:
    ** Keeping store of all available 'items' in the 'manifest' with their IDs and Locations.
    ** Matching the first 'idref' ID entry of the book's 'spine' (practically the cover page of the book)
       to one of those 'items' and thereby getting its Location.
  * Parse this HTML to get the first img element's src, if it exists.
  * Use the image file got, to generate the cover preview.

There is also a 'reference' tag that supports the special 'type' attribute for 'covers' (as per the new spec), but most books seem to lack that thing and the current approach works for both of those type of books. If this element also needs to be checked, do let me know.

References I used:
  * The ePub format OPF spec:
  * A simple ePub construction guide:
  * A few free ePub files (with proper covers) can be found on
    ** (look under classics, or ones with full free previews) and,
    ** (most are free I think)

Feature entry has also been added to the 4.5 Feature Plan (along with FictionBook docs, which is coming up shortly).

P.s. Shall I also commit this to /trunk/kdereview?


  /trunk/KDE/kdebase/runtime/kioslave/thumbnail/CMakeLists.txt 1102437 
  /trunk/KDE/kdebase/runtime/kioslave/thumbnail/epubcreator.h PRE-CREATION 
  /trunk/KDE/kdebase/runtime/kioslave/thumbnail/epubcreator.cpp PRE-CREATION 
  /trunk/KDE/kdebase/runtime/kioslave/thumbnail/epubthumbnail.desktop PRE-CREATION 



Tested with about 4 ePub files only, 1 sourced from Google Books (public domain) and 3 from

I'm looking for other good cover-included free sources of ePub books, but yet to find any (do test with some sources you use). Many places add the cover image but don't link it within the cover page or anywhere else (even the OPF).


ePub Thumbnails in the wonderful Dolphin File Manager



More information about the kde-core-devel mailing list