Scene break images create duplicate image files?

When I use a single image as a scene break via the $img placeholder, and compile to either .epub or .mobi, Scrivener is creating a copy of the image file for every scene break it’s used for, and inserting each of these image files into the compiled ebook file. For example, if I use <$img:fern> as the text separator in the Separators section of the compile options, and the compile will use that image five times, then the resulting ebook will contain five copies of the fern image file, named fern and fern1 through fern4.

This enormously bloats the size of the ebook file. Currently, the only way I know how to fix this is to export as .epub, edit the file in Sigil, search and replace all the image tags to change them all to use just ‘fern’, and delete all the extra copies of the fern image file.

How do I keep Scrivener from making these extra copies of the image file?

Are you using the latest version of Scrivener, 2.5? I believe this was fixed with that update, or maybe even the one prior to that.

This should have been fixed in 2.4, in fact, so definitely check which version you are using.

Are you using the Mac version (you posted in the Mac section of the forum), or the Windows/Linux version as your profile states? Different implementations have different quirks/limitations.

Thanks for the replies. I’m using Scriv version 2.5 for Mac, and it’s definitely still doing it. Would it matter that the Scriv project affected was created by a prior version?

No it shouldn’t make any difference if the project was created a while back, as the bug fix was to the compile procedure itself—the fix did not require any setting changes from you—it was wholly within how these things are interpreted and acted upon.

The most likely scenario is that there is an option elsewhere in the compiler that is causing this older behaviour to revert. Sometimes an specific option can bypass the bug fix and result in pre-fix behaviour. To test for that, go ahead and save your compile settings using the “Manage…” option at the bottom of the Format As drop-down menu, then select Original, then plug in your <$img:fern> code into the Text/Text separator and see if a simple vanilla compile to ePub reproduces the problem.

If compiling as Original works, go back to the preset manage palette and export your settings to a file and send that in via support, referencing this thread URL so they can direct me to your ticket. We’ll try to track it down from there.

If it happens with Original however, then don’t bother sending the settings in, it must be some other factor.