Sigil-Ebook / Sigil

Sigil is a multi-platform EPUB ebook editor
GNU General Public License v3.0
5.96k stars 578 forks source link

It's like all images were deleted from the Images folder randomly #707

Closed ScrawnyPetauro closed 1 year ago

ScrawnyPetauro commented 1 year ago

Bug Description

Hi,

Every once in a while, the following happens while I am working on an ebook:

  1. I load the images through the insert image tool in Sigil
  2. They display correctly in the text
  3. Apparently at random, instead of the image I see the broken image icon
  4. The file is apparently still in the Images folder (I can see it in the file explorer on the left), but if I click on the file name it gives me the broken image as well
  5. I have to re-import all images

Am I doing something wrong?

Thanks!

Platform (OS)

Windows (Default)

OS Version / Specifics

Windows 11

What version of Sigil are you using?

current

Any backtraces or crash reports

No response

dougmassay commented 1 year ago

You don't happen to be editing the epub on two different machines, do you? One with a case-sensitive file system and one without (Windows)? If you change the case on some of the image filenames, that will definitely break the links between the images and the xhtml/xml.

kevinhendricks commented 1 year ago

Or are you leaving Sigil running for days at a stretch with an epub being edited (never closing it)? If so, Windows has this "feature" where it will delete files in the its tmp folder right out from under the application that is using them. They will still appear in BookBrowser because the object pointing to them still exists but the actual file was deleted by Windows.

Sigil makes heavy use of the tmp folder for working on open epubs. Coupling that with this horrible Windows "security feature" will cause exactly what you are seeing.

You can:

  1. stop leaving epub files open overnight and longer and start saving them and exiting out of Sigil before Windows can delete these files.

  2. turn off this self-cleaning security feature in Windows so it will stop deleting files out from under Sigil.

  3. Use Sigil's Preferences to set a new tmp folder you have created for Sigil (then restart Sigil for it to take effect). This folder will not be "cleaned" by Windows so the issue stops. This is why this Preference was added to Sigil in the first place.

kevinhendricks commented 1 year ago

Closing as a known issue with certain user work patterns interacting with a Windows/macOS "feature" than can itself be disabled through some OS obscure settings, or that can be prevented by creating and setting your own Sigil tmp folder in its Preferences and restarting Sigil.

kevinhendricks commented 1 year ago

FWIW, with the next release Sigil will change its default scratch pad/workspace to be inside its own controlled Sigil Preferences folder to prevent issue with OS's that indiscriminately erase "older" files from its tmp folder.