# EPUBCheck PKG-021: corrupted image file, how to fix it

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

EPUBCheck PKG-021 is an error message: “Corrupted image file encountered.” An image file inside the EPUB is damaged and cannot be decoded. Reading apps will show a blank space or a broken image where it is used.

- Official message (EPUBCheck 5.4.0): Corrupted image file encountered.
- Default severity: Error

## Typical causes

- An image truncated during a copy or download.
- A file with an image extension whose content is something else, such as an HTML error page saved as .jpg.
- An image written by a faulty export or conversion tool.

## How to fix it

1. Open the image named in the message on its own to confirm it is damaged.
2. Export the image again from its source, replace the file and keep the same name, or update every reference to it.
3. Validate again.

## When it's not this

If the image is fine but its extension does not match its format, that is PKG-022.

## Sources

- EPUB 3.3, §3.2 Core media types: https://www.w3.org/TR/epub-33/#sec-core-media-types (read 2026-11-04)

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