How do I get the images back that have disappeared from my Writer document?

I am running Libre Office 6.3.4.2(x64) on Windows 10 Home Edition. I had created a 642 page document with 51 photographs saved as an .odt file. The photos were all in the document until today when I exported 9 pages as a .pdf file. After this, I noticed that all but two of the photos had disappeared. The captions have remained in some cases but there is no trace of the pictures or their frames.

I am in hopes that someone can tell me how to recover the photos without having to re-create the entire photo section of the book.

Thanks.


Update:

I have a backup copy of this document that was saved the day before the disappearing-image incident. This copy has all the pictures in the correct places and is only missing my last day’s work on the index. I can re-do the work on the index BUT, I would appreciate knowing how to prevent a recurrence of the photos disappearing. Are there any settings I need to check? Should I save my work in a different format than .odt? Or in several different formats? I’m open to anything at this point if it will prevent a repeat of this near-disaster.

Thanks in advance for any help and also to those who have already replied to this topic. I appreciate your input.

After a clear assignment of the problem was not possible so far, I have the following tips:

  1. First of all, make a copy of your document.
  2. ODT is definitely the right format.
  3. Resize the pictures, especially the big ones. Usually 200-300kB is enough.
  4. Make a copy again.

I wish you success!

BUT, I would appreciate knowing how to prevent a recurrence of the photos disappearing

That’s a correct attitude; yet, I suppose that that’s you who can do a great good deed to the community by discovering the circumstances that result in the loss; and then creating a bug report on that, providing a sample document and steps needed to reproduce the loss. That would allow developers to reproduce the problem and fix it. Thank you!

There can be several reasons for this.

  1. Your pictures are very large and need more time to be displayed.
  2. If the images are not embedded but linked, the path may have changed.
  3. You did not anchor embedded images to the paragraph. They are now somewhere in the document.

PS: Basically, embedded images should only be as large as necessary. Crop or reduce the images beforehand with an image editing program. Anchor the pictures at the desired paragraph.

  1. The pictures are mostly between 35KB and 1MB in size. The two largest ones are 27MB and 10MB. I have never had to wait for them to display.

  2. The images are embedded.

  3. The images were anchored to the paragraphs. They are nowhere in the document. The document was originally 642 pages and about 100,000KB. It is now 626 pages and 756KB.

27 MB and 10MB image sizes are far, far too big!

Assume you have an A4 page and you want a full width image which is 8.25 inches. Printing at 150 dpi gives excellent quality so your image needs to be 8.25 x 150 = 1,250 pixels wide. A typical 1,250 pixel wide photo saved as a JPG with QF = 85 is less than 400 kBytes.

See the Tutorial I referred to in my comment below. You need to resample the images and make sure they as saved as JPG or PNG in the file appropriately.

Also you may have pasted photos into the document which is very bad as such a pasted image is necessarily saved as a PNG and it will be many times bigger than a JPG.

If you upload the file with all the images to Dropbox or Google Drive or a file share site, and send the link to john.ha24 followed by at followed by yahoo.co.uk, I will examine the file for you.

If your images are embedded then

  1. rename the file from fred.odt to fred.zip
  2. double-click fred.zip.
  3. double-click the folder called Pictures.

How many image files do you see in the folder?

If you are not sure if they are embedded or linked then go Edit > Links to external files. This displays a list of all linked files and their locations. If you have no linked files it is greyed out.

Are the images in the specified locations? If you moved the .odt file then you must also move the files so they are in the same location relative to the .odt file that they were before.

I did steps 1-3 and there were 4 image files in the folder. These are the same 4 images that remained in the document after the others disappeared.

There were no linked files when I checked that setting.

The remaining images are near their specified locations. The missing images have the captions also near to their specified locations but are also shifted around somewhat. The .odt file and the image files are all in their original locations.

As all images are embedded and there are only four left in \Pictures the other images have been lost from the file. I am very surprised as LO recently spent 40,000 Euro rewriting the image handling code to fix this specific problem.

  1. What level of LO are you running? The new code appeared in LO 6.1.

  2. Did you have Tools > Options > Load/Save > General > Save Autorecovery information …, set to ON? I have lost images in AOO (which has much common code) at the precise moment at which the Autosave takes place.

  3. Read [Tutorial] Some useful hints on using images for more suggestions. The problem seems to be worse if the images are large (over 1MB) and if there are many (50) of them.

  4. Switch off displaying images while editing the file. Tools > Options > LO Writer > View > untick display graphics. The loss occurs when images are swapped out of memory - this prevents that swap.

See Bug 47148 (Image-Caching) - [META] Image handling problems which starts with

The code we’ve inherited that deals with image caching, swapping in, out, lifecycle management of images via strings, swapping in and out to documents etc. is broken beyond belief.
This is a tracker bug to start aggregating these horrors.

and goes on to say

[T]he majority of the problems are now solved with the work from Tomaz, see https://blog.documentfoundation.org/blog/2018/06/19/image-handling-rework-for-libreoffice-collaboras-tender-results/. Not closing yet, there are still a few problems remaining, see the unresolved dependent bugs.

and

I’ve noticed that if I worked on the document for a short time, save it, and quit, I wouldn’t see the problem. I’ve turned off autosave, and haven’t seen the issue since. [I]t seems that regular save – ctrl-s, or from the file menu – doesn’t corrupt the document.

Thanks to everyone for the suggestions.

At this point, I’ve turned off autosave and disabled the displaying of images while editing the file. I’m also saving copies frequently after re-enabling the display of images and checking that the pictures are still there. So far so good. If the problem shows up again, I’ll create smaller .jpg files of the images and replace all of the current larger ones.

When I’m not so pressed for time, I will take an earlier copy of the document that still has the images in it and, using the original settings in LO, try the actions I did that made the pictures disappear. If that happens, I will document what I did and share it in this thread.

I’ve noticed this problem in recent documents. I’m using version 7.0.3.1. I normally put the images in a table that has 2 columns. I just re-inserted images into this document. Many images just disappeared. I post this to confirm that problem still exists. Normally, I decrease size of images to be less than 500 Kb. I think problem started when I put images in the document of 8,000 to 10,000 kb, using the raw size from camera rather than editing them to decrease size. One or 2 large images appear to upset all the other images and have all disappear.