threepress-bars-small.png

From the Threepress Consulting blog:

Apple’s iBookstore requirement that all files in the .epub must be listed in the OPF manifest has caused a lot of headaches for content producers. There’s no such requirement in the actual EPUB 2.0 specification, and therefore no test for this condition has been in epubcheck.

However, the vast majority of cases where this occurs are unwanted accidents: publishers including backup files, unused images, or operating system cruft like “.DS_Store.” It’s surprisingly easy to generate very large .epub files due to multiple backups, so while it’s not a formal requirement of the spec, it’s a reasonable best practice.

We consulted with other EPUB developers and have contributed a patch to epubcheck to flag files that are missing from the manifest as a warning. There are three exceptions to this rule:

  • Required files that aren’t meant to be in the manifest, like mimetype.
  • Any files listed in META-INF/container.xml, including the OPF file itself.
  • Any files found in the META-INF directory.

All other unmanifested files will generate a warning:

WARNING: ./general/Unmanifested.epub: item (Unmanifested.txt) exists in the zip file, but is not declared in the OPF file

More details available in the original issue.

We’d like the community to review the patch to ensure that we’ve caught all the necessary cases. If you find a problem, report it as a formal bug, not as a comment here (or do both!). Please include a sample EPUB file as an attachment in the issue so we can generate a test case to verify the fix.

You can download the latest code (revision 135+) either from Google Code as source, or just download epubcheck-1.0.6-dev.jar.

Because this is a developer preview, our online EPUB validator does not use this version. If you are not familiar with how to run epubcheck from the command-line, please continue to use the online version.

Do not use this build for production systems.

If no problems are found we propose that the formal revision number become epubcheck 1.1 to reflect the increase in functionality. We plan to continue work on additional outstanding epubcheck issues as well.

NO COMMENTS

The TeleRead community values your civil and thoughtful comments. We use a cache, so expect a delay. Problems? E-mail newteleread@gmail.com.