Bug 154682 - AutoCaption does not apply to an Image cut and pasted within a document or pasted to another document
Summary: AutoCaption does not apply to an Image cut and pasted within a document or pa...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.7.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: AutoCaption 154686
  Show dependency treegraph
 
Reported: 2023-04-06 14:31 UTC by sdc.blanco
Modified: 2023-04-13 14:15 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2023-04-06 14:31:02 UTC
1. Insert and copy an image in a document (or copy an existing image in a document).
2. Enable "LibreOffice Writer Image" in Tools - Options - LibreOffice Writer - Autocaption
3. Paste the copied image in the same (or a new document). 

Actual:  AutoCaption is not applied.
Expected:  AutoCaption is applied.

According to [1], AutoCaption:  

"Specifies the settings for captions that are automatically added to inserted objects."

Maybe "inserted objects" must be understood literally and exhaustively (i.e., AutoCaption is applied ONLY to inserted objects).

Will ask UXEval if that is the intention.  If yes, then the documentation should probably "highlight" or "emphasize" that aspect more. Or if this should be considered a bug.  In this connection, see bug 51850 (for additional relevant complications) and bug 61222, which shows that users expect that cut-and-paste should trigger AutoCaption.

Also tested with

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1e9f4de320f67d1218c710bcee1969a2324c6888
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL threaded


[1] https://help.libreoffice.org/7.6/en-US/text/shared/optionen/01041100.html
Comment 1 m_a_riosv 2023-04-06 15:16:20 UTC
Because you are copying the image not the Frame with the image

After your second step,
a) Right-click to insert caption, now you have the image and the frame containing it.
b) Also, Menu/Insert/Image adds the frame with their caption.

If you copy the frame, the caption is applied, if you copy only the image, not, if I'm not wrong because the caption is a property of the frames not the images.

Pasting from spreadsheets doesn't the caption.
Comment 2 sdc.blanco 2023-04-06 18:08:13 UTC
(In reply to m.a.riosv from comment #1)
> Because you are copying the image not the Frame with the image
The question though is whether AutoCaption should be applied to a copied image.

> b) Also, Menu/Insert/Image adds the frame with their caption.
Correct. Also my experience and consistent with current help page.
 
> If you copy the frame, the caption is applied, 
Do not repro.  
1. Turn off AutoCaption for Frames.
2. Insert a frame.
3. Turn on AutoCaption for Frames.
4. Copy and paste frame.

Actual:  No caption applied to pasted frame.

> if you copy only the image, not, 
Which is the claim in the OP.

> Pasting from spreadsheets doesn't the caption.
Bug 61222
Comment 3 Heiko Tietze 2023-04-11 11:22:10 UTC
To insert or pasting from the clipboard or dragging from the Gallery are different actions. I understand why the auto caption doesn't kick in but I'm not sure if this is what the average user expects. Assuming it is possible to detect whether the clipboard content is a table, what I doubt and just to make it more complicated, I could imagine to break morfe workflows if the auto caption would be added than we do good with solving an inconsistency.

I would just add a note to the help. André, what do you think?
Comment 4 Daveo 2023-04-11 12:56:40 UTC
This looks very much like a duplicate of the 11 year old NEW UNRESOLVED Bug 51850.
Why should it matter whether the image in the document is a copy of an image from a file in any directory (incl. The Gallery) or a copy from the clipboard? The image is in the document, so why does the code illogically try to differentiate between the insertion mechanisms?
Comment 5 Heiko Tietze 2023-04-11 12:58:12 UTC
(In reply to Daveo from comment #4)
> Why should it matter whether the image in the document is a copy of an image...

The question is can we apply it consistently, and at least for tables I doubt that.
Comment 6 Daveo 2023-04-11 13:19:49 UTC
(In reply to Heiko Tietze from comment #5)
> (In reply to Daveo from comment #4)
> > Why should it matter whether the image in the document is a copy of an image...
> 
> The question is can we apply it consistently, and at least for tables I
> doubt that.

Unclear how tables are involved in captioning images. Regardless of images being inserted or pasted into cells of a table they can be captioned, autocaption does not work in either case.
Comment 7 Heiko Tietze 2023-04-11 13:26:20 UTC
Tools > Options > Writer > AutoCaption is available for many different types of content.
Comment 8 Daveo 2023-04-11 13:28:28 UTC
OK I now see that image and table captions have been lumped together in the insertion code. Looks like a dead end for users who need an better process for captioning pasted images.
Comment 9 sdc.blanco 2023-04-12 11:38:41 UTC
(In reply to Daveo from comment #4)
> looks very much like a duplicate of bug 51850.
The difference is that bug 51850 was directed at external sources, in particular images copied from webpages, which is why I opened this ticket for "internal" sources (images in the same document or images copied from one document to another). Of course, if the same underlying code is involved, then mark this one as DUP and revise the bug summary for bug 51850 to highlight the general problem.

@Heiko - at present, the online help of AutoCaption gives no indication about "limitations" or "special conditions".  Usually online help aims to document "expected behavior" (without mentioning any bugs).  As noted in the OP, maybe users should only expect AutoCaption to work with "Insert - Image" (which is what the help page says -- but it could probably be emphasized more explicitly).

More generally, if this limitation ("must use Insert - Image) is going to be the intention. Then this would also give a WF to bug 51850, because external sources must be saved first, and then inserted.  (I am not advocating for this solution -- just seeking some improvement in the documentation of the current situation).
Comment 10 Heiko Tietze 2023-04-13 14:15:09 UTC
We discussed the topic briefly in the ESC meeting and at least for images it's feasible to detect what is in the clipboard- and consequently apply a caption. We need to consider the situation when the clipboard contains image and text, which could be a caption.

Until the enhancement is done I'd add a note to the help that autocaption explicitly requires Insert.