EPUB FixerKDP upload error scanner

EPUB error guide

PKG_021 corrupted image file encountered

Use this when EPUBCheck reports PKG_021 or says a corrupted image file was encountered. Locate the packaged image before editing OPF or rebuilding the EPUB.

Scan the EPUB to check file paths and see what can be repaired or needs manual review. Your original EPUB stays unchanged.

No signup before the scan report.Your original file is not overwritten.Repair download only after EPUBCheck passes again.

Need fixed-layout, DRM, or source-file help? Check unsupported or review-first EPUB cases.

Match these report titles

  • PKG_021 corrupted image file encountered
  • Corrupted image file in EPUB
  • EPUB image cannot be read
  • KDP rejected EPUB corrupted image

Start here

Locate the damaged image before editing OPF.

In an EPUB package, PKG_021 means the image file itself may be unreadable. A manifest edit cannot repair a truly corrupted asset.

Matched

What it means

The EPUB points to an image file, but the packaged image may be damaged or not actually readable.

Matched

Can it be fixed automatically?

It can be repaired only when the image is readable and the problem is a clear media-type or extension mismatch.

Matched

What to check next

Copy the exact image path from the validator message.

Matched

What not to assume

It is unsafe when the image bytes are damaged, the source asset is missing, or a replacement image must be chosen.

1. Example report output

What a PKG_021 report should show.

The report should name the exact image path and whether the bytes can be recognized.

EPUBCheck message

ERROR(PKG-021): Corrupted image file encountered.

Affected file

OEBPS/Images/cover.jpg.

EPUB Fixer report

Image header is unreadable; manifest says image/jpeg.

Do this next

Restore or re-export the original image when the binary is damaged.

Do not do this

Do not change OPF media-type if the image bytes are truly corrupted.

Safe repair is limited to metadata or extension mismatches; corrupted image bytes need source replacement.

2. Next step

Decide whether the image is damaged or mislabeled.

Those cases need different next steps.

Scan first

Read the image header.

Check whether the file bytes match JPEG, PNG, SVG, or another declared type.

Safe repair

The file is only mislabeled.

Correct manifest media type or extension when the image is readable and the true format is clear.

Manual review

The image is corrupted.

Restore the original source image or re-export the EPUB.

3. Concrete path example

A typical corrupted image report.

The scanner should show whether the file can be recognized at all.

EPUBCheck:
ERROR(PKG-021): OEBPS/Images/photo.jpg: Corrupted image file encountered.

Report:
Manifest media-type: image/jpeg
Detected file header: unreadable
Image bytes: damaged or incomplete
Fix decision: manual source asset replacement
Next: restore photo.jpg from the source project and export again

If the header is readable as PNG while the file is named .jpg, use the media-type mismatch path instead.

Quick decision

Do not solve corrupted image bytes with OPF edits.

The scanner can identify the affected asset, but it should not invent replacement image content.

Scan first

Name the exact image path.

Find the packaged file and compare binary header, extension, and manifest media type.

Safe fix

Only the label is wrong.

Correct metadata or extension only when the image file itself is readable.

Stop

The binary is damaged.

Return to the source image or export tool instead of editing OPF.

Common situations

Common PKG_021 cases.

Most corrupted image errors need source asset review, not package guessing.

The image file is incomplete.

The file may have been truncated during export or ZIP editing.

Restore the original asset before retrying.

The extension and bytes disagree.

A PNG might be named .jpg or declared as JPEG.

Use the media-type mismatch path if the image is readable.

The cover image is damaged.

KDP may reject the EPUB because the packaged cover cannot be decoded.

Replace the cover from the source design file.

Several images fail after compression.

A batch image process may have damaged assets.

Re-export from clean images rather than patching one line.

The PKG_021 corrupted image error text

PKG_021: Corrupted image file encountered.

Where corrupted image errors appear

EPUBCheck or a publishing platform tries to read an image in the EPUB and the file cannot be decoded as a valid image.

What it means

The packaged image cannot be read as the format it claims to be.

The image may be truncated, corrupted, mislabeled, exported incorrectly, or damaged during ZIP edits.

Before you edit

Check the image file, extension, and manifest media type together.

A safe repair is possible only when the issue is metadata or extension mismatch. A damaged binary usually needs the original source image.

  1. 1Copy the exact image path from the validator message.
  2. 2Check whether the file exists inside the EPUB package.
  3. 3Read the image header and compare it with the file extension.
  4. 4Compare the file format with the OPF manifest media-type.
  5. 5Restore the source image if the binary is unreadable or incomplete.

Why KDP checks it

Why validators check image file integrity.

EPUB 3.3 package rules

The OPF file is the EPUB's map: metadata, file list, reading order, and navigation wiring. KDP and EPUBCheck use it to decide whether the book package is coherent.

EPUBCheck

EPUBCheck checks EPUB 2 and EPUB 3 files against the official rules and reports package, markup, link, and file-reference problems.

KDP eBook file formats

KDP supports EPUB files that meet Kindle Publishing Guidelines and recommends checking the file with Kindle Previewer before upload.

Repair example

When PKG_021 can be repaired safely.

Before / after example

Before: EPUBCheck cannot decode the packaged image. After: the package is fixed only if the file is readable and mislabeled; otherwise the source image must be restored.

Ready to retry?

Scan the image asset before replacing files.

Upload the EPUB that produced PKG_021. The report should name the image path and whether the file is unreadable, mismatched, or missing.

Upload EPUB to scan

FAQ

Questions authors ask about PKG_021.

Can EPUB Fixer repair a corrupted image file?

Only if the file is actually readable and the issue is a clear label mismatch. Damaged image bytes need the original source image or a new export.

Should I change the OPF media type for PKG_021?

Not unless the scan proves the image bytes are valid and only the manifest label is wrong.

Can a corrupted image make KDP reject an EPUB?

Yes. KDP and Kindle Previewer may reject a package when a required image cannot be read.

Is this the same as cover-image property missing?

No. cover-image is OPF wiring. PKG_021 means the image file itself may be unreadable.

Related EPUB error guides