EPUBCheck MED-003: img in picture not core type
Updated:
EPUBCheck MED-003 is an error message: “Picture "img" elements must reference core media type resources, but found resource "…" of type "…".” An img inside a picture element points to an image in a format that is not a core media type. Inside picture, the img must always reference a core image type (JPEG, PNG, GIF, WebP or SVG) so every reading app can show it; EPUBCheck names the file and its type.
The official message
Picture "img" elements must reference core media type resources, but found resource "%1$s" of type "%2$s".
- 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
- TIFF, BMP, HEIC or other formats that reading apps are not required to display.
- A picture element written for the web, with the modern format in img and the fallback in source.
How to fix it
- Convert the image to JPEG, PNG, GIF, WebP or SVG and update the src and the manifest media type.
- If you want to offer another format, put it in a source element with a type attribute, and keep a core format in the img.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If a source element in the picture lacks a type attribute for a foreign format, that is MED_007.
Terms used here
Other MED messages
MED-004Image file header may be corrupted.MED-005Media Overlay audio reference … to non-standard audio type … found.MED_007Picture "source" elements must define a "type" attribute when they reference foreign resources; found resource "…" of type "…".MED-008The time specified in the clipBegin attribute must not be after clipEnd.MED-009The time specified in the clipBegin attribute must not be the same as clipEnd.MED_010EPUB Content Documents referenced from a Media Overlay must specify the "media-overlay" attribute.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.