EPUBCheck OPF-029: file is not its media type
Updated:
EPUBCheck OPF-029 is an error message: “The file "…" does not appear to match the media type …, as specified in the OPF file.” A file's content does not match the media type declared for it in the manifest. EPUBCheck looks at the file itself, so a wrong declaration can make reading apps try to decode it in the wrong format.
The official message
The file "%1$s" does not appear to match the media type %2$s, as specified in the OPF file.
- Default severity
- Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- A PNG declared as image/jpeg, or the reverse.
- A file converted to another format without updating the manifest.
- A file renamed with a new extension without being converted.
How to fix it
- Check the real format of the file EPUBCheck names (an image editor or the
filecommand will tell you). - Change the manifest media-type to that real format.
- Or convert the file to the format the manifest declares, keeping its name and references consistent.
When it's not this
If only the extension disagrees with the format, EPUBCheck reports PKG-022.
Terms used here
Other OPF messages
OPF-028Undeclared prefix: "…".OPF-030The unique-identifier "…" was not found.OPF-027Undefined property: "…".OPF-031File listed in reference element in guide was not declared in OPF manifest: ….OPF-026Found malformed property value: "…".OPF-032Guide references "…" which is not a valid "OPS Content Document".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.