Create an Ebook with Images and Stable Relative Paths

To create an ebook with images without losing assets, connect three records: the image reference in the manuscript, the relative path after a move, and the resource packaged in the EPUB. In a controlled three-chapter Rune Studio sample, five inline images were inserted and one referenced image was moved. Readback found zero uses of the old path, one use of the new path, and the same one-file, one-occurrence usage count after the move.

The rebuilt EPUB mapped the five inline source images to five distinct packaged resources by matching file contents. It contained six image resources in total when the cover was included, with no missing images. This is evidence for one controlled move and one rebuilt package, not a guarantee about every project, reader, or retailer.

Fix the five inline assets at their manuscript references

The sample used three chapter files, C01.md through C03.md. Its inline assets were inline-01.png through inline-05.png, plus a separate cover named cover138.png.

Inline asset Manuscript Alt text Move exercise
inline-01.png C01.md Inline figure 1 None
inline-02.png C01.md Inline figure 2 None
inline-03.png C02.md Inline figure 3 Move from images to assets
inline-04.png C02.md Inline figure 4 None
inline-05.png C03.md Inline figure 5 None

This table starts with references, not loose files in a folder. All five images were inserted as Markdown image references: two in the first chapter, two in the second, and one in the third. The cover was configured separately and was not counted as an inline reference.

The same method works without Rune Studio. Record the manuscript, asset identity, relative path, alt text, and occurrence count on one row. After export, match those rows to the resources and image elements inside the EPUB.

Resolve every path from the manuscript

A relative path begins at the manuscript that contains the reference. From chapters/C02.md, the original path to images/inline-03.png was ../images/inline-03.png.

After the image moved into assets, the reference from the same chapter needed to become ../assets/inline-03.png. Moving only the file would leave a stale path in the manuscript, which can turn into a missing image during export.

Rune Studio's current Mac documentation describes relative-path updates for Markdown images and links in txt, text, md, and markdown files after file or folder moves and renames. External URLs and page fragments are outside that range. That documentation defines the supported area; before-and-after counts show what happened in this particular sample.

Measure one referenced move before and after

The move exercise used inline-03.png because C02.md already referenced it once. The operation was measured as follows:

Checkpoint Files Occurrences Manuscript path
Before the move 1 1 ../images/inline-03.png
Rewrite plan 1 1 Target: C02.md
After the rewrite 1 1 ../assets/inline-03.png
Old-path search 0 0 No stale reference

The image was moved from images to assets, the planned reference in C02.md was rewritten, and the manuscripts were searched again. The new path appeared once in the same chapter. A fresh usage check still reported one referencing file and one occurrence.

Old-path zero is not enough on its own. Deleting the reference would also produce zero. The acceptance rule is that the old path reaches zero while the new path preserves the original file and occurrence counts.

Map five source images to five packaged resources

After the rewrite, the three chapters were exported again. The EPUB was unpacked, and each source image was matched to a distinct packaged resource by file-content identity. The chapter XHTML contained five inline image elements.

Package check Observed result
Inline source images 5
Inline image elements in chapter XHTML 5
Distinct packaged resources matched to inline sources 5
Total image resources including the cover 6
Missing images 0
Local structure result valid=true

In the current result, the five image references in the manuscripts map one-to-one to five inline image resources packaged in the EPUB. One referenced image was also tracked after it moved: the old path appeared zero times, the new path appeared once, and usage remained one file with one occurrence. The separately configured cover accounts for the sixth image resource.

This mapping is limited to file-content identity and XHTML references. Visual image quality, spoken rendering of alt text, and retailer-side recompression were not tested. The local valid=true result also does not establish retailer acceptance.

Treat stable paths as a repeatable acceptance equation

For an image-bearing ebook, use this equation: intended inline assets equal referenced assets, referenced assets equal mapped package resources, and the reference count before a move equals the new-path count after it. Track the cover on a separate row.

In this sample, the equation is five inline sources, five references, five mapped inline resources, six total resources with the cover, and zero missing images. For the moved inline-03.png, the evidence is old path zero, new path one, and one file with one occurrence both before and after.

Start with one referenced image in a copy of your own project. If Rune Studio is one of your options, review the current Mac feature range on the product page, then compare the old path, new path, usage count, and rebuilt EPUB before applying the same move to your working manuscript.