[Solved] Default Anchor when inserting image from Gallery

Discuss the word processor
Post Reply
brunnerdan
Posts: 43
Joined: Tue Nov 29, 2011 12:41 am

[Solved] Default Anchor when inserting image from Gallery

Post by brunnerdan »

Is possible to add an image in a gallery with some formatting properties. My use case is the following. I have a document with a table (3 x 3) and I would like to fill in the table by adding images from the clipart. Every time when I add an image, I have to define the Anchor property "as chartacter" !!! I tried to add again the image once formatted to the gallery, but it's not working (obviously it was working with OpenOffice under Solaris/Sparc but not with OpenOffice on Windows).
Last edited by brunnerdan on Wed Dec 21, 2011 5:26 pm, edited 5 times in total.
OOO 3.3 on Solaris/Windows
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Add an image to a gallery with the property "Anchor - as

Post by acknak »

Material from the Gallery carries no formatting at all.

The anchor property is part of the frame style but it is not exposed in the style editing dialog window.

It used to be possible to add it to a style by first setting the anchor property on an image, then updating the style from the image. This works in OOo 3.21, but not in OOo 3.3--at least I can't get it to work. It might be necessary to edit the document xml directly to change the property.
AOO4/LO5 • Linux • Fedora 23
User avatar
Hagar Delest
Moderator
Posts: 32628
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Add an image to a gallery with the property "Anchor - as

Post by Hagar Delest »

Indeed, it doesn't work anymore. See [Solved] Changing a default Anchor setting.

The workaround given in the bug report is wrong in fact. You've to edit the styles.xml file and change the properties in the following tag:
<style:style style:name="Graphics" style:family="graphic">
text:anchor-type="paragraph" -> text:anchor-type="as-char"
Please add '[Solved]' at the beginning of your first post title (edit button) if your issue has been fixed.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
brunnerdan
Posts: 43
Joined: Tue Nov 29, 2011 12:41 am

Re: [Solved] Default Anchor when inserting image from Galler

Post by brunnerdan »

Thanks, the workaround ist working, but it would be nice to implement this feature in a future release.
OOO 3.3 on Solaris/Windows
User avatar
Hagar Delest
Moderator
Posts: 32628
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Solved] Default Anchor when inserting image from Galler

Post by Hagar Delest »

Then you should add your votes to the report.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Solved] Default Anchor when inserting image from Galler

Post by acknak »

Here's a document with the anchor property changed to "As character" (made with OOo 3.2.1).

You can propagate that change by loading the frame styles from this document into an open document using the "Load Styles" function from the "Styles and Formatting" window.

That's a little easier than editing the xml ;-)
Attachments
Frame_Graphics_As_Character.odt
(8.54 KiB) Downloaded 932 times
AOO4/LO5 • Linux • Fedora 23
brunnerdan
Posts: 43
Joined: Tue Nov 29, 2011 12:41 am

Re: Default Anchor when inserting image from Gallery

Post by brunnerdan »

I tried the document and also the proposal to changes manually the styles in styles.xml, but it doesn't work with OpenOffice 3.3 on Windows! Does someone have any idea how to make it work ?
OOO 3.3 on Solaris/Windows
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Default Anchor when inserting image from Gallery

Post by acknak »

Try this:

1) File > New > Text Document
2) Format > Styles & Formatting (open the styles window)
- Load Styles; tick only "Frame" category
- Tick "Overwrite" ON
- Click "From File" and select the above file; OK
Back in new document...
3) Insert > Picture > From file; select an image; OK
Right-click on image > Anchor: "As character" is already set.

If that doesn't work for you, please explain what you did and what happened.

Loading the modified style into an existing document may not have any effect on frames already present in the document. If the existing frames have had any manual adjustments made to them, the manual changes will obscure the change in the frame style. You have to go back and remove the manual change (Format > Default) and/or re-apply the modified style.
Last edited by acknak on Fri Sep 21, 2012 3:23 pm, edited 1 time in total.
Reason: updated steps: add "overwrite"
AOO4/LO5 • Linux • Fedora 23
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: Default Anchor when inserting image from Gallery

Post by Bill »

acknak wrote:Try this:

1) File > New > Text Document
2) Format > Styles & Formatting (open the styles window)
- Load Styles; tick only "Frame" category
- Click "From File" and select the above file; OK
Back in new document...
3) Insert > Picture > From file; select an image; OK
Right-click on image > Anchor: "As character" is already set.

If that doesn't work for you, please explain what you did and what happened.

Loading the modified style into an existing document may not have any effect on frames already present in the document. If the existing frames have had any manual adjustments made to them, the manual changes will obscure the change in the frame style. You have to go back and remove the manual change (Format > Default) and/or re-apply the modified style.
It does work for me in Vista if the steps are followed exactly, but not if a picture is inserted between steps 1) and 2). With a picture already in the document, Load Styles (Frame selected) in step 2) appears to fail completely. Any pictures inserted in step 3) will still be anchored "To paragraph" instead of "As character". Presumably it would also fail in old documents which already have pictures.

I'm not aware af any method in the UI in Vista to remove direct formatting from frames/pictures. If a frame/picuture is selected, Format > Default Formatting is grayed out.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Default Anchor when inserting image from Gallery

Post by acknak »

Thanks for the test & report, Bill. I see the same problem(s).

If the document already uses the "Graphics" style when you load the updated version (step 2), then you have to make sure to tick the "Overwrite" option in the "Load Styles" dialog. That is one evil dialog window!

I see the same thing with the existing pictures after loading the updated style: Format > Default Formatting is disabled; Ctrl+M doesn't work and neither does re-applying the "Graphics" style. I have to apply a different Frame style, then re-apply the Graphics style to get the updated anchor property to take effect.

At that rate, you may as well just create & apply a new custom style!
AOO4/LO5 • Linux • Fedora 23
brunnerdan
Posts: 43
Joined: Tue Nov 29, 2011 12:41 am

Re: [Solved] Default Anchor when inserting image from Galler

Post by brunnerdan »

Great, now it works ! Thanks to all for your help.
OOO 3.3 on Solaris/Windows
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: Default Anchor when inserting image from Gallery

Post by Bill »

acknak wrote:If the document already uses the "Graphics" style when you load the updated version (step 2), then you have to make sure to tick the "Overwrite" option in the "Load Styles" dialog. That is one evil dialog window!
Aha! I didn't even notice that option. I'm more familiar with copying styles in Word 2000 where the overwrite option is on a dialog box that only pops up if the style already exists.
brunnerdan
Posts: 43
Joined: Tue Nov 29, 2011 12:41 am

Re: Default Anchor when inserting image from Gallery

Post by brunnerdan »

I just noticed a new problem. If the clipart image has been inserted in the gallery via "drag & drop" from a draw document (i.e. without link to the filesystem), the "Anchor as character" is set to "Anchor as paragraph" when inserted in the table. Any help ?
OOO 3.3 on Solaris/Windows
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Default Anchor when inserting image from Gallery

Post by acknak »

I haven't looked at that situation specifically, but I have noticed that drawing objects can be inserted in a Writer document either inside a frame, or without a frame. I'm not sure just now what circumstances produce which outcome, but if the drawing object has no frame, it won't have any applied frame style, either.
AOO4/LO5 • Linux • Fedora 23
brunnerdan
Posts: 43
Joined: Tue Nov 29, 2011 12:41 am

Re: Default Anchor when inserting image from Gallery

Post by brunnerdan »

Great, I think you found out the problem. But I don't manage to add a frame around an image that I added to the gallery via "Drag and Drop" from Draw. Here is how I add the image to the gallery :

1) Select your image (Dog with glasses) picture and select the option <Copy> from the right mouse menu
2) Create a blank "Draw" document and paste the picture in it via the <Paste> option from the right mouse menu
3) Insert the image to the gallery via "Drag and Drop".

The result is an image in the gallery without link to a file.

My question is, how to add a frame around the image between step 2) and 3) of my description ?
OOO 3.3 on Solaris/Windows
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Default Anchor when inserting image from Gallery

Post by acknak »

Ok, I see this as I try it myself...

Starting with some image in a drawing, copy the image into a Writer document by one of three paths:

- Copy/paste from Draw into Writer: result is a bare graphic item with no Writer frame.

- Drag/drop: same as copy/paste

- Copy/Paste Special (as Bitmap): result is a framed image that uses the Graphics frame style.

As far as I can see, it doesn't matter how the image got into Draw, I get the same behavior when copying into Writer.
AOO4/LO5 • Linux • Fedora 23
User avatar
Hagar Delest
Moderator
Posts: 32628
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Default Anchor when inserting image from Gallery

Post by Hagar Delest »

Do you want to add a framed image in the gallery (a pic with a border)? I think it's not possible like that, you've to add the frame to the pic itself (I mean in the .png format if the original pic is in png).
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
brunnerdan
Posts: 43
Joined: Tue Nov 29, 2011 12:41 am

Re: Default Anchor when inserting image from Gallery

Post by brunnerdan »

- Copy/Paste special (as Bitmap) -> the result is really am image with a frame (object) around.

But when I try to add the image to the Gallery (via drag & drop), it is not integrated directly in the gallery, but via a link (.../gallery/dragdrop/dd2015.png). My goal is to integrate it in the gallery without a link, but with a frame (object) around. And that seems "impossible". The reason of the gallery without links is to allow to create an "extension" that contains the gallery. And for the moment I didn't manage to create an extension that contains a gallery with "linked" images.
OOO 3.3 on Solaris/Windows
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Default Anchor when inserting image from Gallery

Post by acknak »

I really don't know much about the inner workings of the Gallery: I don't find it all that useful, and it has some significant limitations.

As far as I've seen, any frame or other wrapping elements are added by the application that receives the item. I don't think there's any way to store arbitrary document content, such as a framed image, in the Gallery.
AOO4/LO5 • Linux • Fedora 23
arfgh
Posts: 566
Joined: Tue Mar 05, 2013 6:44 pm

Re: [Solved] Default Anchor when inserting image from Galler

Post by arfgh »

is it possible to modify all the images anchor from the styles ? By default on drag and drop webtext, all the images have anchor as character and i prefer they be achored to the paragraph. How can i edit that but on the image styles ?

Said by other way, is it possible to adjunt all document images anchor to paragraph at once ?
OpenOffice last version | Mageia Linux x64 | Ubuntu Linux | Windows 8.1 Enterprise x64 | Java last version
Post Reply