EPUBCheck PKG-021: corrupted image file
Updated:
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.
The official message
Corrupted image file encountered.
- 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
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
- Open the image named in the message on its own to confirm it is damaged.
- Export the image again from its source, replace the file and keep the same name, or update every reference to it.
- Validate again.
When it's not this
If the image is fine but its extension does not match its format, that is PKG-022.
Terms used here
Other PKG messages
PKG-020OPF file "…" could not be found.PKG-022Wrong file extension for image. The image is a "…" file but has the file extension "…".PKG-023Validating the EPUB against version 2.0, default validation profile will be used.PKG-018The EPUB file could not be found.PKG-017Uncommon EPUB file extension.PKG-025Publication resource must not be located in the META-INF directory
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.