Bug 82873 - Image inserted in left-aligned paragraph is centered in text area (see comment #15)
Summary: Image inserted in left-aligned paragraph is centered in text area (see commen...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Anchor-and-Text-Wrap 87720
  Show dependency treegraph
 
Reported: 2014-08-20 15:20 UTC by Yousuf Philips (jay) (retired)
Modified: 2023-05-14 19:02 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
how the bullet entries appeared (416.00 KB, image/png)
2014-08-20 15:20 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-08-20 15:20:37 UTC
Created attachment 104987 [details]
how the bullet entries appeared

By default, when you set the before and after text indentation to a paragraph, the inserted image will take up the non-indented part, but when only the before text indent is set, like in a bullet/number list or an indented section, the image is inserted above this section and takes up the full width of the page.

Steps:
1) open new writer document
2) add a bullet entry
3) on the bullet line, add an image

If the image is smaller than the width of the page, it will push the bullet entry to its right as if wrapping was set to after. If the image is larger than the page width, it will shrink the image and place it above the bullet line. Both are shown in the attached screenshot.

But outside of this, i dont understand why the default behaviour of inserting an image would be centered in the paragraph/page when the paragraph alignment is set to left.
Comment 1 A (Andy) 2014-10-15 20:59:25 UTC
Both issues are reproducible with LO 4.3.2.2 (Win 8.1).

For me it is also not clear why the image is centered, for me this seems not to be consistent.
Comment 2 Cor Nouws 2014-12-28 20:39:14 UTC
(In reply to Jay Philips from comment #0)
> If the image is smaller than the width of the page, it will push the bullet
> entry to its right as if wrapping was set to after. If the image is larger
> than the page width, it will shrink the image and place it above the bullet
> line. Both are shown in the attached screenshot.

What works fine for me is adding a space first after the bullet.
The same what one has to do to dumb-paste any text in a paragraph marked as heading or with bullets, to prevent changing the paragraph settings.
So I think there is some consistent - though advanced behaviour - here .. ?
Comment 3 Yousuf Philips (jay) (retired) 2014-12-28 21:25:33 UTC
At the time that i submitted this bug, i assumed that LO was being smart with their insertion code when adding an image (as i assumed optimal meant that it was changing its behaviour depending on the circumstance), but actually it is always adding images as To Paragraph, Optimal, Centered and this is the outcome.

This ties in directly on what should be the default behaviour of inserted images and whether a user should be able to change this default behaviour (bug 87720).
Comment 4 Robinson Tryon (qubit) 2016-08-24 23:14:24 UTC Comment hidden (obsolete)
Comment 5 Heiko Tietze 2017-10-22 07:56:54 UTC
Possible solution is to insert the image As Character by default. That places it behind the bullet, and is also the most likely placement outside lists. Opinions?

(Switching to Writer since Impress has no alignment of images in lists.)
Comment 6 Yousuf Philips (jay) (retired) 2017-10-22 18:05:52 UTC
(In reply to Heiko Tietze from comment #5)
> Possible solution is to insert the image As Character by default. That
> places it behind the bullet, and is also the most likely placement outside
> lists. Opinions?

I'll leave bug 87720 to decide what the default behaviour of inserting an image should be, but i think its useful to have the behaviour change based on context (e.g. inserting an image while selecting a shape will have the image used as the bitmap fill of the shape).

So when a user has the cursor in a list, what is the best behaviour to suit their needs, so they dont have to change anchor?

Regina, Stuart, Cor, Sophie: thoughts?
Comment 7 Regina Henschel 2017-10-22 20:49:01 UTC
I think, that a suitable default is not possible, because the ways images are used are too different. I prefer to have a style for each use case, not a single default. The predefined styles should cover these use cases:
(A) Insert a large image, that will fill an entire paragraph
(B) Insert a small image like icon, key-pictures in similar size as characters
(c) Insert a image, that will have text right or left from it. 

Real problems are:
(1) Selecting the style in the drop-down list while inserting an image does not work. It is always "Graphics".
(2) The user cannot create a style, which contains the desired anchor and position. You need to edit the file format to get your desired style.

For me: First fix the bugs (1) and (2) and then think about defaults.

For me (LO 6.0 Windows) it makes no difference whether I have a normal paragraph or a bullet list.
Comment 8 Yousuf Philips (jay) (retired) 2017-10-23 11:54:05 UTC
(In reply to Regina Henschel from comment #7)
> I think, that a suitable default is not possible, because the ways images
> are used are too different. I prefer to have a style for each use case, not
> a single default. The predefined styles should cover these use cases:
> (A) Insert a large image, that will fill an entire paragraph
> (B) Insert a small image like icon, key-pictures in similar size as
> characters
> (c) Insert a image, that will have text right or left from it. 

Good concept for some image styles, so please file an enhancement report and attach a sample with these styles in it, but regular users dont/wont use styles.

> Real problems are:
> (1) Selecting the style in the drop-down list while inserting an image does
> not work. It is always "Graphics".

bug 107246

> (2) The user cannot create a style, which contains the desired anchor and
> position. You need to edit the file format to get your desired style.

bug 113376
Comment 9 Regina Henschel 2017-10-23 12:39:25 UTC
Problem (1) is bug 79160.
Comment 10 Heiko Tietze 2020-04-16 13:39:04 UTC
We discussed this ticket in the design meeting and welcome the styles idea.

Should we make bug 87742 a duplicate of this ticket as the solution would also be a style?
Comment 11 Wolfgang Jäger 2021-01-02 13:28:03 UTC
The bug doesn't show as described under V 7.1.0.0.beta1. 
This may be due to a changed default anchoring.
Comment 12 QA Administrators 2023-01-03 03:19:09 UTC Comment hidden (obsolete, spam)
Comment 13 Waleed Mortaja 2023-05-14 02:13:16 UTC
The bug still shows for me as described.

Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
7.5.3-1
Calc: threaded
Comment 14 Eyal Rozenberg 2023-05-14 17:11:03 UTC
I find both the bug title and the initial comment too vague. So, I'll take the liberty of rephrasing in my next comment (and you are all welcome to correct me).
Comment 15 Eyal Rozenberg 2023-05-14 17:36:50 UTC
Bug reproduction instructions:

1. Create a new Writer document.
2. Ensure your paragraph, and Default Paragraph Style, are in LTR direction and Left-aligned.
2. Type "Hello world".
4. Place the cursor anywhere in the first paragraph.
5. Insert a small image, which won't cover a lot of the text area's width (say, this one: https://bugs.documentfoundation.org/docs/en/html/_static/bugzilla.png); when inserting the image, don't change the "Style" choice in the insertion dialog.

Expected Results:

The image should be aligned to the left boundary of the text area.

Actual Results:

The image is inserted at the center of the text area (and the paragraph text is placed past it, to the right).


-----------

This happens, in particular, with bulleted/numbered lists, and with non-list indented paragraph (although the placement of the paragraph text depends on whether the indentation is from both sides or just from the start - it may be placed either to the left or to the right of the inserted image.)
Comment 16 Eyal Rozenberg 2023-05-14 17:43:43 UTC
(In reply to Heiko Tietze from comment #10)
> We discussed this ticket in the design meeting and welcome the styles idea.

Maybe, but for now, the default is problematic and surprising to the user.

> Should we make bug 87742 a duplicate of this ticket as the solution would
> also be a style?

No. Plus, defining these styles still doesn't change the problematic default.
Comment 17 V Stuart Foote 2023-05-14 18:21:09 UTC
Actually, styles for frames e.g. inserted Images, would provide anchor and positioning "defaults" for the style see bug 32484 and dupes.

So styles (each with its usage needs for default anchoring) is actually the solution.
Comment 18 Waleed Mortaja 2023-05-14 19:02:18 UTC
(In reply to Eyal Rozenberg from comment #15)
> Bug reproduction instructions
> .....
> 
> Actual Results:
> 
> The image is inserted at the center of the text area (and the paragraph text
> is placed past it, to the right).
Following the new instructions, The image is inserted at the center of the text area but the text remained in its place (to the left of the image).

However, with bulleted/numbered lists, the text (plus the number/bullet itself) of the list item does go to the right of the image as in the first image of screenshot added by Yousfu (https://bugs.documentfoundation.org/attachment.cgi?id=104987). Note how the list bullet is to the right of the image of "finished downloading" in the screenshot.

Also, when an image has a large width, it gets inserted before the whole list item instead of being part of it. This is shown in the second image of screenshot added by Yousfu. Note how the list bullet is below the image of the video in the screenshot, even though it was pasted in that bullet list and should be inserted after that bullet.

I am not sure if "pasted image is inserted at the center (in case of no bulleted/numbered list)" is the same bug as of "pasted image in bulleted/numbered list is inserted before the list item". If not, we may want to submit a separate bug report for one or both of them. What do you think?

> Expected Results:
> 
> The image should be aligned to the left boundary of the text area.
Correct me if I am wrong, but the expected result would be to have the image to the right of the (LTR) text. which is the right boundary of the text. Right?