# MED_007: picture source without type, how to fix it

Source: https://epubcc.com/epubcheck/med_007/ (updated 2026-11-04)

EPUBCheck MED_007 is an error message: “Picture "source" elements must define a "type" attribute when they reference foreign resources; found resource "…" of type "…".” A source element inside picture references a foreign resource without a type attribute. A reading app uses the type to skip formats it cannot show, so a non-core image format must say what it is; EPUBCheck names the file and its type.

- Official message (EPUBCheck 5.4.0): Picture "source" elements must define a "type" attribute when they reference foreign resources; found resource "%1$s" of type "%2$s".
- Default severity: Error

## Typical causes

- A picture element written for the web, where source elements often omit type.
- AVIF, JPEG XL or other newer formats offered without a type attribute.

## How to fix it

1. Add the media type to the source element, for example <source srcset="fig1.avif" type="image/avif"/>.
2. Keep a core format (JPEG, PNG, GIF, WebP or SVG) in the img element of the same picture as the fallback.
3. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

## When it's not this

If the img itself uses a non-core format, the error is MED-003.

## Sources

- EPUB 3.3, §3.5.2.2 HTML img fallbacks: https://www.w3.org/TR/epub-33/#sec-fallbacks-img (read 2026-11-04)

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