Bug 133201 - Linked Image: updating changed path does not make the image visible again; object lost after reopen
Summary: Linked Image: updating changed path does not make the image visible again; ob...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.6.2 release
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, dataLoss, regression
Depends on:
Blocks: Writer-Images
  Show dependency treegraph
 
Reported: 2020-05-20 18:05 UTC by Robert Großkopf
Modified: 2026-05-04 00:48 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
reset mbInBaseLinkSwapIn flag so manual link-path changes in the image properties dialog actually reload the image (727 bytes, patch)
2026-05-04 00:45 UTC, justin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2020-05-20 18:05:47 UTC
Open a new Writer file.
Insert a image with Insert → Image → Insert As Link.
A warning appears while inserting but it works.
Save the file.
Close the file.

Move the file to another location.
Open the file.
Mark the frame for the image, which can't show the image, because the path is wrong.
Open Properties → Image and set the link to the file again.
You could see it in the dialog, but the image doesn't appear in the document.

This bug appears in LO 6.4.4.2 on OpenSUSE 15.1 64bit rpm Linux.
This bug doesn't appear with LO 6.3.5.2, also doesn't appear with LO 6.4.2.2
It first appears here with LO 6.4.3.2
Comment 1 Dieter 2020-05-24 06:19:21 UTC
I confirm it with

Version: 7.0.0.0.alpha1+ (x64)
Build ID: 0e5e935deb0527c64865cfcc53a0421e56b74b6f
CPU-Threads: 4; BS: Windows 10.0 Build 18363; UI-Render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL

and it works with

Version: 6.3.5.2 (x64)
Build-ID: dd0751754f11728f69b42ee2af66670068624673
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded
Comment 2 Buovjaga 2020-06-14 13:50:05 UTC
Bibisected with Linux 6.5 repo to https://git.libreoffice.org/core/+/30b23d77c894bdf6f7ae0d18d594ea267a80f662%5E!/
tdf#131185 Prevent unnecessary SwapIn calls.

Adding Cc: to Gülşah Köse
Comment 3 Gülşah Köse 2021-03-05 15:30:34 UTC
I can not reproduce this


(In reply to Robert Großkopf from comment #0)
> Open a new Writer file.
> Insert a image with Insert → Image → Insert As Link.
> A warning appears while inserting but it works.

Which button did you click here. "Embed graphic" or "Keep Link"

> Save the file.
In which format did you save?

> Close the file.
> 
> Move the file to another location.
Did you move x.odt or image somewhere else?
Comment 4 Aron Budea 2021-03-05 16:37:41 UTC
Reproducible for me in LO 7.2.0.0.alpha0+ (94283af977246c70dbed4452d197b003d8bb14b9) / Ubuntu.

(In reply to Gülşah Köse from comment #3)
> Which button did you click here. "Embed graphic" or "Keep Link"
I chose Keep Link.

> > Save the file.
> In which format did you save?
In ODT.

> > Move the file to another location.
> Did you move x.odt or image somewhere else?
Move the image.
Then when reopening the file, only its empty frame is shown, because the image can't be found at their original set location.
Comment 5 Aron Budea 2021-03-05 16:40:38 UTC
(In reply to Aron Budea from comment #4)
> > > Move the file to another location.
> > Did you move x.odt or image somewhere else?
> Move the image.
> Then when reopening the file, only its empty frame is shown, because the
> image can't be found at their original set location.
Note: this is just the immediate effect of moving the image somewhere else, and not indicative of the bug, which can be seen when continuing with the steps from the bug description.
Comment 6 stragu 2023-12-22 10:10:16 UTC
Commit was also cherrypicked to 6.3.6.

Reproduced in recent trunk build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 29b11fa3b5574dc3f42f55b0716f71054030c6c2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Upping the importance because it's a dataloss regression, see step 7 here:

1. Insert a image with Insert > Image > Insert As Link, confirm "Keep link" in next dialog
2. Save the file (ODT)
3. Move the linked image file to a different directory
4. Reload file: image frame empty, (as expected)
5. Right-click > Properties > Rotation tab > Link > Browse to the new location of the file > confirm: preview is correct in dialog (as expected)
6. Click OK on dialog: image is not visible in document (broken)
7. Save and reload: image completely gone, nothing in Navigator (broken)

I checked that before ddd7277b218204dca539b3f93d36098df0349b38 (which is build commit [ddd7277b218204dca539b3f93d36098df0349b38] in linux-64-6.3 bibisect repo), it works as expected with the same steps.

Gülşah, can you please have another look?
Comment 7 QA Administrators 2025-12-22 03:11:06 UTC Comment hidden (obsolete)
Comment 8 Robert Großkopf 2025-12-22 06:54:41 UTC
Bug still exits in 
Version: 25.8.4.2 (X86_64)
Build ID: 290daaa01b999472f0c7a3890eb6a550fd74c6df
CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

Tested a little bit more: 
After trying to set the new Link to the image I saved the file.
Then I closed the file and reopened it.
The frame for the image won't be shown any more and navigator won't show any object.
Comment 9 justin 2026-05-04 00:45:25 UTC
Created attachment 206917 [details]
reset mbInBaseLinkSwapIn flag so manual link-path changes in the image properties dialog actually reload the image
Comment 10 justin 2026-05-04 00:48:33 UTC
Version 6.3.5.2 is the last working version. All versions from 6.3.6.1 onwards have this bug.
A simple change in SwGrfNode::SwapIn() fixes the current bug, which was caused by an unintended side effect of bug 131185. I have attached a buggy patch file that currently fixes the bug, but it is still incomplete. Someone with more knowledge of the codebase should work on it, not me, I know nothing about LibreOffice.

My documents always use linked images, not embedded ones. LibreOffice is practically unusable if all the images in my documents disappear reproducible one by one after renaming the image files in the file system and trying to update documents.

All versions after 6.3.5.2 do not update linked images if the image target path is corrected (6.3.6.1 and newer).

I would like to point out that no one in this bug report has yet mentioned that the icon in the Navigator (a red cross in my case), which indicates the image status, is also not updating.

The attached buggy and incomplete patch improves the situation as follows:

1. Once the target path of an linked image is corrected, the image in the document is updated after clicking "OK" in the "Image Properties" dialog box, the placeholder disappears.
2. After saving the document, the image remains visible in the document and in the Navigator. That's okay.

While the image status icon in the Navigator still only displays correctly after reopening the document, this is better than nothing. Please note that my patch may have broken the intended behavior of 131185.

My patch only identifies the cause of the error. We now know 131185 really is responsible and what needs to be addressed. Please let's fix this.