Prevent Broken KDP Image Paths Before EPUB Export

An abstract editorial 3D still life illustrating Prevent Broken KDP Image Paths Before EPUB Export

Make the old-path search a pre-export gate

To keep broken image paths out of a KDP-bound EPUB, search for both the old and new paths before export and define numerical stop conditions. This sample used three chapters, three inline images, and no cover. One image was moved, and the explicit rewrite produced zero old-path matches and one new-path match before export.

The EPUB then contained three images, zero missing images, six spine items, three chapter links in both nav and NCX, and valid=true. The status remains partial because automatic tracking, Kindle Previewer, and KDP acceptance were not tested.

Move only one of three body images

chapter01.md through chapter03.md each referenced one inline image, with no cover assignment. Only figure01.png moved from images to assets/illustrations; figure02.png and figure03.png stayed in place.

The starting values were three input chapters, three inline images, no cover, and one old-path reference for the moved asset. Moving only one image isolates the common pre-export defect in which one stale reference is hidden among otherwise valid assets.

Define stop conditions before running export

Search the entire manuscript set for the moved image’s old path and record one match. Move the asset, update the reference, and require old 0 and new 1. Then confirm that all three source images exist, export the EPUB, and require three packaged images with none missing.

Stop before export if any old-path match remains, if the new path does not appear exactly once, or if one of the three source images is absent. The rollback point is the reference edit: restore it and move figure01.png back to images.

The run repaired one reference before exporting three chapters

Stage 4 created three chapters and figure01.png through figure03.png, collected reference usage for figure01.png, reviewed its move, moved it into assets/illustrations, explicitly rewrote one reference, and searched both paths. It then set series and volume data, selected the manuscripts, reviewed the plan, exported, inspected, and read the package, nav, NCX, and XHTML. command_count was 17.

planned_reference_files was 0. The one corrected occurrence therefore cannot be described as an automatic result of moving the file.

Old 0 and new 1 led to packaged 3 and missing 0

Reference values were references_before_move=1, rewritten_occurrences=1, old_path_matches=0, and new_path_matches=1. Export values were input_chapters=3, inline_image_files=3, cover_files=0, image_count=3, missing_images=0, spine_count=6, nav_item_count=3, ncx_item_count=3, and valid=true.

The test checked more than the disappearance of the stale path: all three body images, including the two that did not move, were present in the package. That connects the pre-export path gate to the post-export asset gate.

A separate common Stage 4 run used four chapters, one image, and version 1.4. It produced spine 8, zero missing images, nav and NCX, and valid=true. It remains separate supporting evidence.

Keep KDP and automatic tracking outside partial

The test did not verify automatic tracking after Finder or cloud moves, collaborative edits, changes outside the workspace, visual image quality, Kindle Previewer, physical devices, KDP upload, or KDP acceptance. Local valid=true does not imply a KDP pass.

KDP’s official help lists EPUB as supported and recommends checking the book with Kindle Previewer. This run covers the path and package gates that precede that external review.

State Rune Studio’s product scope separately

Rune Studio’s documented Mac feature set can update relative image and link paths in Markdown-family workspace files after moves or renames and can package images into EPUB 3. Parent-directory paths using ../ are supported, while external URLs and page anchors are not rewritten.

That is Stage 3 product scope. The Stage 4 evidence establishes an explicit rewrite from old 1 to new 1 and a local package containing three images.

Pass both gates before advancing to KDP

The pre-export gate is old 0 and new 1. The post-export gate is packaged images 3, missing images 0, three chapter links in both navigation structures, and valid=true. If either gate fails, return to the reference or source-image record instead of advancing.

This fixture passed both local gates, while its article-specific status remains partial. The result supports an export decision without claiming automatic tracking or a KDP outcome.