Skip to content
EPUBCheck · Package document (OPF)

EPUBCheck OPF-013: declared media types differ

Updated:

EPUBCheck OPF-013 is a warning message: “Resource "…" is declared with MIME type "…" in content, but has MIME type "…" in the package document.” A content document declares one media type for a resource and the manifest declares another. Reading apps may trust either value, so a mismatch can stop the resource from playing or displaying.

The official message

Resource "%1$s" is declared with MIME type "%2$s" in content, but has MIME type "%3$s" in the package document.

Default severity
Warning. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.
EPUBCheck version
5.4.0

%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.

Typical causes

  • An object, embed, link or source element whose type attribute disagrees with the manifest item.
  • A file converted to another format (for example, audio re-encoded) without updating every declaration.
  • A type attribute copied from a web page that used a different format.

How to fix it

  1. Check the real format of the file EPUBCheck names.
  2. Set the manifest media-type to that real format.
  3. Make the type attribute in the content document say the same, or remove the type attribute if the element does not need it.

When it's not this

If the file's content does not match the manifest media type, that is OPF-029.

Terms used here

Other OPF messages

  • OPF-012 Item property "…" is not defined for media type "…".
  • OPF-014 The property "…" should be declared in the OPF file.
  • OPF-011 itemref can’t have both page-spread-right and page-spread-left properties.
  • OPF-015 The property "…" should not be declared in the OPF file.
  • OPF-016 The element "rootfile" is missing its required attribute "full-path".
  • OPF-017 The attribute "full-path" on element "rootfile" must not be empty.

Sources

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.

FAQ

What does EPUBCheck OPF-013 mean?

EPUBCheck OPF-013 is a warning message: “Resource "…" is declared with MIME type "…" in content, but has MIME type "…" in the package document.” A content document declares one media type for a resource and the manifest declares another. Reading apps may trust either value, so a mismatch can stop the resource from playing or displaying.

Is OPF-013 an error?

OPF-013 is reported as warning by default. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.