Writer: Corrupted pictures (mostly cropped in Writer)

I created a lot of .odt files containing pictures that I edited (mostly cropped) directly in LibreOffice Writer. I just discovered that some of the pictures are damaged: part of them is black / grey (sometimes it concerns all pictures in the file, mostly only some or one). Is there any way to recover this pictures? If not, how could I prevent such a behavior? If I copy a picture from another program where I edit them (IrfanView for example) it is OK when I change their size (withouth changing proportion lenght x height) directly in LibreOffice? (I had a lot of problems when opening or changing .odt docs with pictures on another devices but now it seems that pictures are damaged even on the device where I created them.) Thank you!

Additional information:

Windows 10 Pro
LibreOffice 7.4.1.2 (x 64)
Files are saved as ODF - text document odf.

Some examples of how corrupted pictures look like are in the attachment.
libre.pdf (505.8 KB)

I can open most of the files, but I realized that some seem to be corrupted totally:

„General Error: General input/outpur error.“
„Read error - format error discovered in the file in sub document content .xml at position…“

There are also files that have the same size, date and that are despite all classified as different by file synchronizer – and if I open and compare them, I see no difference…

I don´t know if all this errors could have the same cause.

It would be helpful if you mention your operating system, and the LibreOffice version you are using.
And name the file type you are saving in.
Normally, images that are cropped in Writer will still be preserved as a whole image. When you go to crop, you should be able to drag the handles to make the whole image visible again.
An incorrect display of images, does not have to mean that they are destroyed.
You can also test some first steps that have to do with rendering in general.
It would also help if you upload here a sample file (1-3 pages) where the problem is present.
Use for your further messages here, comments or edit their input question above.
Thank you very much.

For photo catalogues, I prefer to do all the editing outside Writer, e.g. with Gimp. Usually my photos are “heavy” (hi DPI so that they are very detailed, large size, high bit-depth up to 16 bits per channel) and would uselessly overcrowd my .odt document. Therefore I make “thumbnails” (up to 6×8 cm though) reducing to ~150 dpi and 8-bit, using high compression JPEG separate from the original. This thumbnail is also cropped so that no extra processing is needed in Writer to minimise .odt file size.

As @Hrbrgr points out, Writer keeps the whole image you provide and only crops/resizes for display. Consequently, if you care for file size and Writer performance, don’t give it data you won’t use.

Thank you for your help, added information about OS etc. to my input question.

@alfons1 ,
to help you further, an attached PDF file is not helpful.
For examination, a source file as ODT would be the right choice.


And I recommend following @ajlittoz 's advice for future edits.

@ajlittoz , Right click and drag the anchor (directly in LibreOffice) - is it OK after editing the picture in Gimp / Irfan View? The finally size of pictures (so as a user see them) cannot be handled separatedly (if I have more text, than the picture is smaller and so on); but I don´t need to change proportion of lengt/size or to do any similar changes directly in LibreOffice.

If I understand correctly your last comment, you have a limited space budget and text + image should use a predefined limited area so that no text => maximum image size, text + image => image shrinks so that there is no overflow.
Unfortunately there is no setting in Writer to automatically adjust image size to allow for neighbouring text volume.

I don’t recommend this approach (though looking nice and intuitive) because it creates direct formatting over the frame style used for the image (there is always one even if you don’t use them explicitly). And if you have customised/created a frame style for your image, all your settings are now wildly overridden and it is very very difficult to reset things to their desired state.

I know frame styles are difficult to tame but this is the only way to get predictable and stable results. You need a lot of practice to succeed but the result is afterwards rewarding.

You know the difference between linking and embedding? You regularly should link images (probably in the same folder or in explicit folder for each document).

Save the images as files and don’t copy/insert via clipboard. Urgently check the [Tutorial] Some useful hints on using images. Later on link the images into your Writer document.

If the images are only embedded in your Writer document a corrupted document can destroy or corrupt them. If linked you don’t lose the original image and can link it again…

Computing never is perfect, people never are perfect or work without any mistakes. So the only way is to act in a structured way and have backups in suitable frequencies. :wink:

Cheers and godspeed!

2 Likes

„If I understand correctly your last comment, you have a limited space budget and text + image should use a predefined limited area so that no text => maximum image size, text + image => image shrinks so that there is no overflow.“

I meant it differently: I changed the picture size manually (right click and drag the anchor directly in LibreOffice) according to (not only) amounth of text. In that point I just explained why it is unconfortable for me to define picture size outside of LibreOffice.

Hrbrgr:
Some examples of corrupted pictures in .odt (only some pictures from my files as original files are too large.

wohnen Sachen Bilder - rücken, Ortspräpositionen ii.odt (596.1 KB)

nehmen Bilder ii.odt (424.8 KB)

„You know the difference between linking and embedding? You regularly should link images (probably in the same folder or in explicit folder for each document).“

I tried to avoid saving pictures as files since it is complicated and would make my folders chaotic (I have many .odt files in one folder - with plenty of pictures). I could not image to stop using LibreOffice as I use it for ages… But now I am beginning to doubt if it is a right choice for me. How about OpenOffice or Microsoft Word? Do you know if successfully saving and viewing files with pictures is simpler with them?

OpenOffice is worse than LibreOffice in some points, see linked Tutorial: " 16. Lost images … and a word of caution about using AutoRecovery. LibreOffice 6.1 and later is now probably better than AOO"
.

Please note that the third number of the version means the bugfix release serial number inside the major version (i.e., you use a first bugfix release inside 7.4 version, after the initial 7.4.0).

Bugfix release means just that: a release containing bug fixes. When a new version (7.4) came out, it was expected that it contained new bugs not caught by all the beta testers. The policy of TDF is to encourage early adopters to use new releases; but TDF informs that it is less stable than the then-current older branch with higher bugfix release number. Until x.y.5, it is considered suited for early adopters.

And indeed, it is not expected that users who take an early-adopter release, would keep it forever: after all, this release is mostly for battle-testing, and preparing more bug fixes.

Current release of 7.4 version is 7.4.7, available on the download page. There was 6 more bugfix releases inside your version, each fixing 50-100 bugs. Why stick to an early adopter’s version so long? :dizzy_face:

1 Like

@mikekaganski
Thanks for your remark, I just updated LibreOffice and though corrupted images in files that I can open are still corrupted, I am able to access some files that I could not even open before.

It seems there is no way how to restore my images in files like them posted here. As I don´t want to create a new topic, I try to ask here: can .odt files with corrupted images be at least detected by some special software? There are many.odt files I have. Since FreeFileSynchronizer can compare them and reveal files with the same time and size but different content, I can tell that some of them are corrupted if I have a backup of them in a different folder. However, without a backup, I can only find these files “one by one” or (that is much better) when I really need them. It would be better for me to investigate the whole extent of the damage during my "holiday“.

If it is not possible, could I automatically detect .odt files that are corrupted „as a whole“ (cannot be opened)? I can imagine it may be tricky since it is difficult to say which file is corrupted (some are irreparably corrupted and some are not)…

.
I once experienced that cropped images (cropped in Writer) can cause some bad PDF files. To improve the situation one could crop the images before inserting in Writer.
.

advice

  • move or insert images into Draw, crop them, copy them into clipboard and…
  • paste (paste special) them into Writer as a bitmap image
    or
  • crop the images in an image processing app (GIMP; IrfanView…) and then add it to your Writer text.
    .

This is more work but pays off in stabler Writer files.

I recently discovered (or rediscovered) that any material modified by Draw turn into drawing objects. Drawing objects are not controlled by frames (and can’t be presently) which makes it quite difficult to position them where you want (this must be done on each of them individually). You can mitigate by anchoring As character but this does not offer all the versatility of frames and you must do this with some paragraph style which has not the same purpose.

If pasted as a bitmap image (paste special) the objects lose their drawing properties, dont’t they?

Mmmh … I’ll have to check, but it is possible since you tell explicitly this is an image. However, it becomes a bitmap, i.e. it can’t be scaled and possibly will print bad if the dpi is not a “good” multiple or sub-multiple of the printer.

@ Grantler
Thank you for your remarks. Please, is it possible to find out if a picture was (earlier) pasted as bitmap image or somehow else? If pasted simply through “paste” (and not paste special), images are not pasted as bitmap images - am I right? And is it possible to estimate the probability image / whole files go corrupted when edited in IrfanViewer and then pasted as bitmap?

It is the crucial for me as I don´t want to repeat actual experiences: the files were saved normally, I opened them normally, and after some time, they went corrupted without any clear reason (I can only suspect it has something to do with using my USB flash disc on different devices). Linking them could solve my problem for the future but it would my folders make so chaotic that I would rather save my files as .pdf (but the disadvantages are enorm and I would like to avoid this “solution”).