Bug 152704 - WRITER: Linked image does not update after selecting another file in Properties dialog.
Summary: WRITER: Linked image does not update after selecting another file in Properti...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.6.0 target:7.5.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Files-Linked
  Show dependency treegraph
 
Reported: 2022-12-28 10:20 UTC by tomasz.sztejka@polon-alfa.pl
Modified: 2023-03-18 11:19 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Narrow image (90 bytes, image/png)
2023-03-16 12:46 UTC, Buovjaga
Details
Wide image (288 bytes, image/png)
2023-03-16 12:46 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tomasz.sztejka@polon-alfa.pl 2022-12-28 10:20:53 UTC
Linked image does not always update __VISUALLY__ in document when user changes the source image.

Version: 7.4.3.2 (x64) / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 16; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: threaded


Steps to reproduce:
1.Prepare two images, one very wide (A), second (B) tall and narrow and of both sizes larger than sizes of image A. The difference in proportions do help to expose the bug.
2.Create empty document.
3.Insert->Image
   Select wide image (A), check "linked" to make it linked.
4.Observe image is inserted and shown correctly.
5.Right click on image and select Properties->Rotation->Link->Browse.
6.Select tall image (B), remember to check "linked" (Bug 61358), click OK.
-------- first bug is here: ------
7.Observe that in properties dialog in the preview the tall image is now drawn OVER the wide image.
---------------------------
8.Resize the dialog a bit by dragging it. Observe that now preview is drawn correctly.
9.Click OK in dialog
10.The image in document __did__ change (it depends).
11.Again right click the image, select Properties->Rotation->Link->Browse
12.Select narrow image (A), remember to check "linked" (Bug 61358), click OK.
13.Observe, that preview is now drawn __correctly__
14.Click OK in dialog.
--------- second bug here: -------
15.Observe that now the image in document did NOT refresh.
-----------------------------
16.Now try one of following:
  - save document - see, that image do refresh
  - try to resize image - see it do refresh.
  - try to resize LO window - see it do refresh

Those steps can be also reproduced when one edits the file name in "link" input line, but in such case neither preview nor image in document do refresh.

This is a regression, in previous versions (I can't say which tough, I suppose somewhere around 6.4 line) editing file name always did update an image.

From my knowledge the change in image is incorrectly detected as "no need to repaint" and does not propagate to document rendering code even tough data are updated as they should be.

Workaround:
 The fastest way to enforce repainting is to click "Save".
Comment 1 Dieter 2023-01-12 07:45:00 UTC
(In reply to tomasz.sztejka@polon-alfa.pl from comment #0)
> Steps to reproduce:
> 1.Prepare two images, one very wide (A), second (B) tall and narrow and of
> both sizes larger than sizes of image A. The difference in proportions do
> help to expose the bug.

Thnak you for reporting the bug. But I don't understand how to create a narrow image, with a larger whidth than a very wide image.
Comment 2 tomasz.sztejka@polon-alfa.pl 2023-01-12 14:49:04 UTC
My bad at English wording

Example:

  A: 10x100 pixels
  B: 1000x200 pixels
Comment 3 Buovjaga 2023-03-16 12:46:48 UTC
Created attachment 185999 [details]
Narrow image
Comment 4 Buovjaga 2023-03-16 12:46:58 UTC
Created attachment 186000 [details]
Wide image
Comment 5 Buovjaga 2023-03-16 12:49:20 UTC
(In reply to tomasz.sztejka@polon-alfa.pl from comment #0)
> Steps to reproduce:
> 1.Prepare two images, one very wide (A), second (B) tall and narrow and of
> both sizes larger than sizes of image A. The difference in proportions do
> help to expose the bug.
> 2.Create empty document.
> 3.Insert->Image
>    Select wide image (A), check "linked" to make it linked.
> 4.Observe image is inserted and shown correctly.
> 5.Right click on image and select Properties->Rotation->Link->Browse.
> 6.Select tall image (B), remember to check "linked" (Bug 61358), click OK.
> -------- first bug is here: ------
> 7.Observe that in properties dialog in the preview the tall image is now
> drawn OVER the wide image.

Bibisected with linux-64-6.2 to 6b7819dbe09d5aef3acf20a5acc807afbdcacc20
weld SwGrfExtPage

(In reply to tomasz.sztejka@polon-alfa.pl from comment #0)
> 11.Again right click the image, select Properties->Rotation->Link->Browse
> 12.Select narrow image (A), remember to check "linked" (Bug 61358), click OK.
> 13.Observe, that preview is now drawn __correctly__
> 14.Click OK in dialog.
> --------- second bug here: -------
> 15.Observe that now the image in document did NOT refresh.

This is bug 133201 (which I fortunately found early and could quickly confirm with 7.0 bibisect repository).
Comment 6 Commit Notification 2023-03-16 20:20:25 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/aa252a2d019c350d90b7c4a090246451a6006b87

Resolves: tdf#152704 old image remains underneath when new image drawn

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Caolán McNamara 2023-03-16 20:59:22 UTC
done in trunk, backport to 7-5 in gerrit
Comment 8 Buovjaga 2023-03-17 14:26:48 UTC
Verified, thanks

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f0ff4243d45b11f372a2ed824fbb8806de9cb595
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Comment 9 Commit Notification 2023-03-18 11:19:13 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/631215d52a78b728b0b2f3438b2faa9ce24a5960

Resolves: tdf#152704 old image remains underneath when new image drawn

It will be available in 7.5.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.