Bug 121378 - Writer/UI: Adding Captions to Images is very Unpractical (Width of Image Changes with Width of Frame, Does not use Default Frame Style etc)
Summary: Writer/UI: Adding Captions to Images is very Unpractical (Width of Image Chan...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: Caption
  Show dependency treegraph
 
Reported: 2018-11-12 20:42 UTC by Adalbert Hanßen
Modified: 2022-04-28 11:33 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Bug report with some screenshots (65.02 KB, application/vnd.oasis.opendocument.text)
2018-11-12 20:44 UTC, Adalbert Hanßen
Details
The dialog for Caption settings looks like this (76.31 KB, image/jpeg)
2018-11-13 01:46 UTC, Dieudonne Dukuzumuremyi
Details
After inserting Caption, the cation is taken by the size of the image (56.90 KB, image/jpeg)
2018-11-13 01:47 UTC, Dieudonne Dukuzumuremyi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adalbert Hanßen 2018-11-12 20:42:30 UTC
Description:
This report was made with LibreOffice Writer Version: 6.1.2.1, Build ID: 65905a128db06ba48db947242809d14d3f9a93fe, CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk2; Locale: de-DE (de_DE.UTF-8); Calc: group threaded run on Xubuntu 16.04.3 LTS with current kernel 4.4.0-116-generic x86_64.
Probably it is present in all other versions of LO too.

If I add a caption to an image, the width of the caption is taken automatically as the width of the image. That’s quite unpractical for narrow images because the caption spans several lines and becomes unreadable. If one enlarges the width of the frame (e.g. to 100% width of the paragraph), the size of the image is also blown up to frame size of the frame introduced by the function Insert>Caption. One has to click outside the frame and its contained image, then on the image itself and reset to the original size or to the size which the image was given before. That’ very clumsy.

After the frame size has been widened, the size of the image is also blown up.
After the picture has been resized to its original size still the frame size is bigger than necessary. Although the position is set to “Below” a forced linefeed before the term is missing.

By manually resizing the frame height I finally get the size I actually wanted.

I could place a paragraph mark before Figure but no manual line break! So I also have to modify the Spacing below for the style “Figure“ to prevent a too much space below the picture.

I tried to modify the default alignment for “frame” in order to let the caption be placed in a frame
100% of the current paragraph width,
alt least 4 mm height but it shall extend automatically if the content needs more space, 
left aligned
but the caption and the image shall be centered with respect to the frame (which can be achieved by changing the default setting for the paragraph styles for Caption and Figure). Unfortunately the horizontal placement and the anchoring options are inaccessible in the dialog to modify my document’s stylesheet. They only become accessible for an existing frame anchored to a paragraph. But even then the frame is offset to the right by 2 mm (try it out: this is probably a real bug). Unfortunately I could not update the style for a frame to become the default style for any new frame. I did not find a workaround to streamline at least the placement of the caption-frame.
I propose to provide a standard frame for image captions and one for table captions which will be automatically taken for all new frames produced by the function Insert Caption.
Further observation: No footnote can be attached to a caption because subdialog items of Insert Footnote and Endnote are greyed out if the cursor is on a caption. Fortunately I can edit a caption. But it should be possible to attach a footnote to it (like image taken from …).

Steps to Reproduce:
1. Paste a narrow picture to a LO Writer document
2. Make a caption for it
3. widen the width of the caption's frame 

Actual Results:
In step 2 the width of the caption is taken from the width of the image
In step 3 the size of the picture changes. There also should be a forced linefeed after it.



Expected Results:
Size of the image does not change when the frame for the caption is resized.
It should be possible to define properties for a default frame for a caption: in the most general case one for all tables, one for all images.

One should be able to define horizontal alignment for these prototypes in the <F11> Mange Styles dialog.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: de-DE (de_DE.UTF-8); Calc: group threaded
Comment 1 Adalbert Hanßen 2018-11-12 20:44:14 UTC
Created attachment 146575 [details]
Bug report with some screenshots
Comment 2 Dieudonne Dukuzumuremyi 2018-11-13 01:44:06 UTC
I used LibreOffice Version: 6.1.2.1 (x64)
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
CPU threads: 8; OS: Windows 6.3; UI render: default; 
Locale: en-US (en_US); Calc: group threaded

Steps:
1. Created a new Writer file
2. Insert a new Picture: Isert menu-?Image-> select image from my computer
3. Insert a Caption: Insert Menu-> Caption
4. Fill the Caption text in Dialog wizard
5. Clock Ok.

Received result:
The result is the same as you reported. The caption is taken by the size of the inserted picture.
Comment 3 Dieudonne Dukuzumuremyi 2018-11-13 01:46:21 UTC
Created attachment 146578 [details]
The dialog for Caption settings looks like this
Comment 4 Dieudonne Dukuzumuremyi 2018-11-13 01:47:20 UTC
Created attachment 146579 [details]
After inserting Caption, the cation is taken by the size of the image
Comment 5 Thomas Lendo 2018-11-30 20:50:49 UTC
For me, this is an expected behavior. I want that the frame and the picture have the same dimensions and that the picture is 'linked' to the frame so that the picture also changes when the size of the frame changes.

Many users don't know the difference between frame and picture. With the current behavior its easier for them to work with pictures that include captures.

That a caption's width is limited to the picture is a side effect of this behavior but every change would create many new bug reports.
Comment 6 Thomas Lendo 2018-11-30 20:54:03 UTC
For every frame style problem, please create a new bug. Keep it short and present reproducible steps or use cases. One bug for one issue.
Comment 7 Timur 2019-05-10 14:37:12 UTC
I would like this to be as requested. But that would require a change in image and frame logic.
Comment 8 Heiko Tietze 2019-05-10 19:12:47 UTC
The caption requires a frame so the request is to have the initial frame width like the page width (and not scale the image). I would expect "relative size" and 100% does the trick but doesn't. Regina, any idea?

Second part is about the paragraph style "Figure" that is applied to above the image and not the caption text. Reason here is that the figure that has no break nor is anchored as character. I don't see a solution.
Comment 9 csongor 2020-11-17 13:28:28 UTC
Here is what I do (LO 7.0.1.2).

- Paste a small picture
- add a long caption by right click -> Insert Caption
- click away to remove the focus from the frame
- right click on the image, Properties -> Type tab -> turn OFF the "Relative to" checkboxes
- click on the frame
- make it wider so that the caption fits into one line
- make it lower so that there is no big gap within the frame, under the caption.

This is quite cumbersome. 

The really annoying thing is that the frame keeps its height and leaves a large gap under the caption. I understand that when [X] Autosize is turned on, the "Height" label is changed to "Height (at least)" but it shouldn't. Autosize should simply mean it decreases the height as much as it can.

If Autosize would allow the height to shrink then the process would be one step simpler.


The absolutely convenient solution would be if I could define a style 
- for newly inserted images: I could set the Width to Autosize, rather than "Relative to the paragraph with: 100%"
- for frames for the images: I would set its Width to Autosize.

The Autosize width ad height for the Image is the original size of the image as long as it fits between the margin, otherwise the distance of the horizontal/vertical margins.

The Autosize width for the Frame would mean maximum(wImage, wCaption) where 
- wImage is the width of the image and 
- wCaption is the width of the caption when it is broken into as few lines as possible while the lines still fit between the margins.
Comment 10 Cor Nouws 2020-11-18 15:30:55 UTC
behavior as old as Metusalem
Comment 11 Heiko Tietze 2020-11-19 13:35:57 UTC
(In reply to csongor from comment #9)
> The absolutely convenient solution would be if I could define a style 
> - for newly inserted images: I could set the Width to Autosize, rather than
> "Relative to the paragraph with: 100%"
> - for frames for the images: I would set its Width to Autosize.


Agree. Let's make sure the "Graphic" frame style by default used for images is applied to images (it is highlighted but not effective, meaning the properties are different). This disabled the "Relative to" option and users can resize the surrounding frame. In addition, we have to insert a paragraph break after the image, and update the "Figure" paragraph style that is used for the caption so it has no unreasonable spacing to the graphic.

needsDevAdvice for missing technical considerations and perhaps code pointers.