Skip to content
EPUBCheck · Package and ZIP container

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

  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.

Terms used here

Other PKG messages

  • PKG-020 OPF file "…" could not be found.
  • PKG-022 Wrong file extension for image. The image is a "…" file but has the file extension "…".
  • PKG-023 Validating the EPUB against version 2.0, default validation profile will be used.
  • PKG-018 The EPUB file could not be found.
  • PKG-017 Uncommon EPUB file extension.
  • PKG-025 Publication 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.

FAQ

What does EPUBCheck PKG-021 mean?

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.

Is PKG-021 an error?

PKG-021 is reported as error by default. 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.

PDF to EPUB tools

Every tool uses the same engine and starts with a free 5-page sample.