Posted on by & filed under bookworm, epub.

If you’re producing ePub files, take the time to ask yourself two simple questions:

  1. Are all the files I listed in the OPF file actually in the ePub archive?
  2. Are all the files in the archive in the OPF file?

The OPF file is meant to be the canonical listing of all resources in your ePub.  If it’s in the ZIP but not in the OPF, reading systems are required to ignore it.  Likewise, including an entry in the OPF but not including the actual file (or putting it in the wrong folder) is also an error.

Bookworm used to reject ePubs which failed the first case, but I saw so many bad files (usually missing CSS or images) that it now simply ignores the error.

However, I sometimes also see case #2, where the OPF file is missing resources (again, frequently CSS and images).  For example, these ePubs from Hindawi Publishing Company make admirable use of SVG, but none of their SVG files are in the OPF.  Bookworm can’t find them and therefore can’t display them.

EpubCheck does flag both of these cases with the following errors:

  1. Case 1, where the file is declared in OPF but not in the archive:  resource ‘XXXX.html’ is missing
  2. Case 2, where the file is in the archive but is missing from the OPF: referenced resource exists, but not declared in the OPF file

Other explanations for error messages from EpubCheck.

Tags: bookworm, EPUB, epubcheck, opf, SVG,

One Response to “Quick ePub check”

  1. Richard Pipe

    This point about the OPF puts to rest my doubts about not handling fonts that are not registered in the manifest. It’s hard to make a decision to reduce a user’s experience, but it is ultimately the package that defines the format.

    This approach works for me – Tough with the OPF, relaxed with the files.

    If you are brave enough to ignore Hindawi’s quite wonderful SVG equations, we will be brave enough to ignore Adobe’s missing fonts from the OPF.