WynSnow sent me the files. The .odt file had about 50 small images, all embedded, all JPG and quite small (600 x 900 x 24 bit), anchored to a character and set to Optimal page wrap. Total .odt was 1.8 MBytes and when unzipped, the 50 JPG images in Pictures were 1.8 MB (images were 6kB to 90kB). The file was mainly direct formatting, but was well constructed - there manual page breaks at almost every page separating the pages and preventing any spills rippling through to the bottom.
Despite several hours of stress testing with the graphics cache parameters set to very small values, AutoSave and Save a Backup Copy both set to OFF, I was unable to break the files or lose any images from them.
When you get the Read Error like below, it is because Writer cannot find the image file in the Pictures folder, so Writer displays just the area in which the image should be shown. I can force the error by closing Writer, deleting images from the Pictures folder in the .odt file, and re-opening the file. If, and a big if, this is what is happening, the question we all need to answer is why Writer sometimes seems to lose files from this folder
Writer writes (and often updates) the image files its temporary folder while the document is open for editing, especially as I had set Remove from Memory After to 1 minute. It is very noticeable when you scroll the 50 page document that scrolling through the document causes files to be written to ...\AppData\Local\Temp\. Although there were 49 images, the file count in the Temp folder rose to about 90 on occasion.
I then tried a bit of brute force and ignorance and, while Writer was open, I deleted some of the image files in the temporary folder. Writer still saved the .odt file successfully. Note that whereas the file containing the text content was marked by Writer as being open, preventing it from being deleted; the image files were not so marked, and could therefore be deleted even though Writer was using them.
This gave a clue. I shut Writer, restarted it and it opened with a new document which Writer called Untitled 1.
Note that this document had never been saved. I then added some images, and deleted some of the temporary image files from the ...\AppData\Local\Temp\ folder. The document still looked perfect on the screen with all images present. I clicked Save and saved the document (as a .odt).
So, the first reproducible way to lose images is to
work on a file which has never been saved
1 Create a new document. Do not save it - if you save it as a .odt even once, the images will not be lost
2 Add images
3 Delete the temporary image files in ...\AppData\Local\Temp\
4 File > Save As ..., and save as a .odt file.
The images are missing from the saved .odt file and you get the Read Error message when you open it.
The second reproducible way to lose images is to
work on a .doc file which has already been saved, as:
1 Open a .doc file which has images, or to which you add images
2 3 Delete the temporary image files in ...\AppData\Local\Temp\
3 File > Save ..., and save the .doc file.
When I opened the document, the images were not there and I got the Read Error message. Strangely, on reopening the .doc file, I just got grey outlines where the images should have been and no "Read Error". Writer handles .doc files differently from how it handles .odt files.
Possible cause?
If people have configured a "disk clean" application (there are many available) so that it deletes the temporary files in ...\AppData\Local\Temp, then images will be lost in both cases above.
The temporary files which Writer writes in ...\AppData\Local\Temp are set so that Users cannot delete them - they can only Read and Execute them. It requires a user or application with Administrator privilege to delete them. Of course, 99.9% of PC users run with Administrator privilege, so they or any application they run can presumably delete the temporary files. But, whereas the file containing the text content was marked by Writer as being open, preventing it from being deleted; the image files were not so marked, and could therefore be deleted even though Writer was using them.
I think this is a useful route to investigate further for the "My images have disappeared" problem.
Advice to users is therefore
1 Always work in and save Writer documents as .odt files
2 If you File > New ... and create a new document, save it earlier rather than later - once saved, you protect yourself even if you later lose the temporary files in the temp folder because Writer now treats your file as a .odt file.
3 Set the Graphics Cache options as below.
Edit: Another thought which needs more work. Note the Remove from memory after ... is set to only 10 minutes below. We now all have lots of memory so I think this should probably be set to a longer time - say 60 minutes. It should certainly be longer than the AutoSave time. Users should try to remember to save their file every "less than 60 minutes" so that image files never get removed from memory before being saved once. I wonder if this timer is set to zero at each Save? or if it contunues running from when the document was first opened? |
4 Set AutoSave to ON and Always Create a Backup Copy to ON (Tools > Options > LoadSave General). (But don't forget that highly_personal-bak will still be in the Backup folder long after you have deleted highly_personal.odt.)
5 Check if you are running any "disk clean" utilities to be sure they are not deleting files from ...\AppData\Local\Temp. Windows itself does not delete files from the ...\AppData\Local\Temp\ folder but many utilities do - for example, CCleaner does, but it only deletes files over 24 hours old.
6 Never leave a document "open" even if you have saved it. Always go File > Close..., or shut down Writer. THis is "just in case" because if you just go File > Save ..., the .odt file is saved (which should fully protect it??) but the temporary files remain in the ...\Temp folder (which shouldn't be a problem??).
Edit: It may also be sensible to use a different folder for temporary files rather than the default ...\AppData\Local\Temp which utilities may clear out. Tools > Options > OpenOffice > Paths > Temporary files ... Edit it to somewhere else - for example, create a folder in the Profile such as C:\Users\John\AppData\Roaming\OpenOffice\4\user\New temp. No utilities will know about it so files will be safe from being deleted. |