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 when the message does not name the affected path. The report shows affected paths and repair decisions, not manuscript text.

Fixed-layout, DRM, or source-workflow issue? 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

Use this guide when

Your message matches "PKG_021 corrupted image file encountered" or one of the report titles above.

Upload if

You have the exported reflowable .epub and need the affected path, file, field, or repair decision before editing.

Handle outside this tool

Use the source tool or publishing workflow for DOCX, PDF, KPF, KCB, fixed-layout, comics, image-first books, DRM, visual design, or KDP listing and approval problems.

Read the scan report

Decide if this report item matches.

Use the report label, affected file, and repair decision together. A matching title alone is not enough if the file path or EPUB structure points to a different problem.

Match the report title.

Look for "PKG_021 corrupted image file encountered" or the closest title above. Keep the original EPUBCheck, KDP, or Kindle Previewer wording if it differs.

Check the affected file first.

Use the Affected area, Source file, Target file, or Problem type rows before editing OPF, nav, XHTML, CSS, or image paths.

Follow the repair decision.

Repairable means one clear structural change. Needs review or Not supported means use the named file, source project, or platform step.

Keep with your repair note.

Copy these fields from the report instead of rebuilding the fix from memory.

Source file
Target path or field
Original error
Repair decision
Next step

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.

Start here

Locate the damaged image before editing OPF.

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.

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 EPUB points to an image file, but the packaged image may be damaged or not actually readable.

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.

Can this be fixed safely?

When PKG_021 can be repaired safely.

When automatic repair is safe

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

When you need manual review

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

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