Skip to content
EPUBCheck · Package document (OPF)

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

  1. Check the real format of the file EPUBCheck names (an image editor or the file command will tell you).
  2. Change the manifest media-type to that real format.
  3. 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-028 Undeclared prefix: "…".
  • OPF-030 The unique-identifier "…" was not found.
  • OPF-027 Undefined property: "…".
  • OPF-031 File listed in reference element in guide was not declared in OPF manifest: ….
  • OPF-026 Found malformed property value: "…".
  • OPF-032 Guide 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.

FAQ

What does EPUBCheck OPF-029 mean?

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.

Is OPF-029 an error?

OPF-029 is reported as error by default. 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.