Page 1 of 1

[Solved] Default Anchor when inserting image from Gallery

Posted: Tue Nov 29, 2011 12:43 am
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).

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

Posted: Tue Nov 29, 2011 3:13 am
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.

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

Posted: Tue Nov 29, 2011 1:26 pm
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.

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

Posted: Wed Nov 30, 2011 12:09 am
by brunnerdan
Thanks, the workaround ist working, but it would be nice to implement this feature in a future release.

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

Posted: Wed Nov 30, 2011 12:18 am
by Hagar Delest
Then you should add your votes to the report.

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

Posted: Wed Nov 30, 2011 12:55 am
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 ;-)

Re: Default Anchor when inserting image from Gallery

Posted: Wed Nov 30, 2011 3:08 pm
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 ?

Re: Default Anchor when inserting image from Gallery

Posted: Wed Nov 30, 2011 3:30 pm
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.

Re: Default Anchor when inserting image from Gallery

Posted: Wed Nov 30, 2011 6:09 pm
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.

Re: Default Anchor when inserting image from Gallery

Posted: Wed Nov 30, 2011 8:39 pm
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!

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

Posted: Wed Nov 30, 2011 11:40 pm
by brunnerdan
Great, now it works ! Thanks to all for your help.

Re: Default Anchor when inserting image from Gallery

Posted: Wed Nov 30, 2011 11:46 pm
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.

Re: Default Anchor when inserting image from Gallery

Posted: Tue Dec 06, 2011 3:47 pm
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 ?

Re: Default Anchor when inserting image from Gallery

Posted: Tue Dec 06, 2011 5:59 pm
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.

Re: Default Anchor when inserting image from Gallery

Posted: Tue Dec 06, 2011 7:21 pm
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 ?

Re: Default Anchor when inserting image from Gallery

Posted: Tue Dec 06, 2011 10:47 pm
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.

Re: Default Anchor when inserting image from Gallery

Posted: Tue Dec 06, 2011 10:50 pm
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).

Re: Default Anchor when inserting image from Gallery

Posted: Wed Dec 07, 2011 3:22 pm
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.

Re: Default Anchor when inserting image from Gallery

Posted: Wed Dec 07, 2011 5:25 pm
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.