Epub-specs: What files are allowed in META-INF?

Created on 7 Jan 2019  路  12Comments  路  Source: w3c/epub-specs

OCF says,

All other files within the OCF Abstract Container MAY be in any location descendant from the Root Directory, provided they are not within the META-INF directory.

but also says

This directory contains the files specified in META-INF Reserved Files. Files other than the ones listed in that section MAY be included in the META-INF directory;

I just made an EPUB with a content document in META-INF. EPUBCheck did not complain, and the file worked as expected in several reading systems.

Perhaps we should delete ", provided they are not within the META-INF directory."?

Spec-OCF

Most helpful comment

In particular, files referenced from any Rendition of an EPUB SHOULD NOT be in META-INF.

I think this contradicts the first statement.

How about a fuller rewrite to also focus on the "configuration" aspect. So change the the following paragraphs in 3.2 to:

The OCF Abstract Container MUST include a directory for configuration files named META-INF that is a direct child of the container's Root Directory. Requirements for the contents of this directory are described in META-INF Directory.

and swap your should not to a must not

All other files within the OCF Abstract Container MAY be in any location descendant from the Root Directory, provided they are not within the META-INF directory. In particular, files referenced from any Rendition of an EPUB Publication MUST NOT be in META-INF.

and then change the paragraph in 3.5.1 to:

This directory is reserved for configuration files, in particular those specified in META-INF Reserved Files. OCF Processors MUST NOT fail when encountering configuration files they do not recognize.

That should make it about as clear as we can get.

All 12 comments

Perhaps we should delete ", provided they are not within the META-INF directory."

Or file a bug with epubcheck... ;)

The META-INF directory is supposed to be reserved for configuration files like the ones we do list, or so I've always understood it. My vote would be to keep that separation intact and perhaps better explain what is meant by allowing other files in it (i.e., other configuration files). META-INF has never been very well introduced, to be honest, so unless people know it from jar files, etc. it's probably a bit of a head scratcher.

Or file a bug with epubcheck... ;)

Although that makes the most sense, I'm worried about effectively invalidating existing content. But then that content would likely be broken anyway due to the differing base URI inside META-INF? It all makes my head spin.

I'm worried about effectively invalidating existing content.

I think this one might be more theoretical than practical. In all my days picking apart epubs for accessibility, I've never seen a content file inside of META-INF. There also used to be (may still be?) bugs referencing content outside of the directory that the package document is in, and most epubs I've ever seen follow the practice of isolating the content within a subdirectory. (That came up when we were looking at multiple renditions and sharing content, so it's been a few years.)

The EBPAJ profile clearly recommends a different directory (/item) for all user files.

Perhaps a warning from EPUBCheck if a file referenced from a package document is in META-INF?

All other files within the OCF Abstract Container MAY be in any location descendant from the Root Directory, provided they are not within the META-INF directory. In particular, files referenced from any Rendition of an EPUB SHOULD NOT be in META-INF.

Do some ebook stores use META-INF for proprietary DRM files?

@murata2makoto -- I think Dave's warning would be okay, as any such files wouldn't be listed in the Publication's Package manifest (and FWIW, I've never seen such thing happen, anyhow).

In particular, files referenced from any Rendition of an EPUB SHOULD NOT be in META-INF.

I think this contradicts the first statement.

How about a fuller rewrite to also focus on the "configuration" aspect. So change the the following paragraphs in 3.2 to:

The OCF Abstract Container MUST include a directory for configuration files named META-INF that is a direct child of the container's Root Directory. Requirements for the contents of this directory are described in META-INF Directory.

and swap your should not to a must not

All other files within the OCF Abstract Container MAY be in any location descendant from the Root Directory, provided they are not within the META-INF directory. In particular, files referenced from any Rendition of an EPUB Publication MUST NOT be in META-INF.

and then change the paragraph in 3.5.1 to:

This directory is reserved for configuration files, in particular those specified in META-INF Reserved Files. OCF Processors MUST NOT fail when encountering configuration files they do not recognize.

That should make it about as clear as we can get.

LCP uses META-INF/license.lcpl.

Though not referenced from the Publication's Manifest, right? Similar to Apple's old fixed layout metadata? These both would be okay as "configuration" files in META-INF.

@GarthConboy

Though not referenced from the Publication's Manifest, right?

I believe so. It is referenced by encryption.xml.

Shall we clean this up in 3.3? Looks like we have a reasonable proposal.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BCWalters picture BCWalters  路  6Comments

murata2makoto picture murata2makoto  路  3Comments

murata2makoto picture murata2makoto  路  3Comments

mattgarrish picture mattgarrish  路  10Comments

dauwhe picture dauwhe  路  3Comments