Can't insert image into frame

Hi - I am trying to insert an image into a frame, but after I insert a frame, when I try to insert an image, nothing happens! I’ve even tried dragging an image into the frame. Is Writer automatically creating a frame for the image if I simply insert the image into the text area?

And describe exactly what you are trying to do.


And please specify your operating system, the LibreOffice version and the file storage format.
Thanks.

An image is a frame by itself. So, don’t try to insert it into a frame. Frames are difficult to master; don’t make things worse. Stick to the KISS principle.

A frame is an “escape mechanism” allowing an “object” to be managed separately from the main text flow. As such the frame can be positioned anywhere in the page. When you anchor a frame inside another frame (in fact you anchor it to text inside the frame), the “escape mechanism” is again valid which means the inserted frame is by no means constrained inside the outer frame. You can still position the “inner” frame anywhere.

In your case, insert the image without caring for anything else; just take care for the anchor point. After that, apply an adequate frame style. By default, an image is styled Graphics. Either modifiy this built-in style to fit your needs, or create a dedicated user-style.

IMPORTANT: never anchor your image To page. This anchor mode is not what you think. It detaches the frame from your text to glue it to a physical page. For most people, this causes problems when you edit your text. Don’t confuse anchor mode and position. Except for As character anchor mode, a frame can be sent absolutely anywhere in the page.


PS: for more specific information, mention OS name, LO version and save mode as already requested. The latter is the most important. If you save DOCX, all recipes will fail or be unstable. Only .odt is reliable.

1 Like

Why shouldn’t an image be inserted into a frame?
Writer does this directly when you insert a caption to an image.

`
The reason for inserting an image in a frame is precisely that, to place a caption for the image or to have a frame with text that also contains an image - if you do not want to have consecutive numbering of the frames.

  • What you should not do is insert an image into a frame if the frame is going to contain only one image.

Note there is a major difference between Insert > Frame > Frame interactively and Insert > Text Box; Text Boxes cannot contain images, only text.
.
I have no problem with inserting an image into a frame made for the purpose. I sometimes use this to leave space for an image or advertising so I don’t have to reflow everything.
.
Just insert the image into the text area and set appropriate wrap, etc. Or use @ajlittoz method

Thanks, everyone. I’ve taken the advice of just inserting the image and then selecting the option for adding a caption; this works. But frames are funky, I think. IMHO, the frame + image should be automatically a grouped item; that is, you should be able to move the whole group at once by clicking anywhere within the frame, including the image, without specifcally having to grab the handles on the frame. Grabbing the frame is tricky, at least for me. If I miss it, and click on the image, I end up sliding the image out of the frame. Is there an option to have the image + frame locked together as a group, a single unit? Would make things easier.

You can lock the image’s position in the frame. Right click on the image, select Properties > Options and, under Protect* select Position. You still have to drag the outer frame but it would not move the image if you tried to drag it.

If you click inside the frame you enter the frame, you do not select the frame and generally the image is selected.
To select the frame you must click on the edge of the frame.

To check what you have selected the best option is to right click and choose Properties from the pop-up menu, which will open a dialog,
The dialog title indicates whether you have selected a Frame or Image.

Then you can move or set the properties of the image or the frame

Inserting an image into a frame is useful only when the frame contains something (is not empty). For example there is already text in the frame. Otherwise it has no purpose and only puts stress on Writer, degrading performance and robustness.

In at least half the cases, it is wrong. Very often, the "caption’ is part of main text and its location is significant regarding reading order. Then it is much simpler to anchor the image to the “caption” paragraph. This is the exact opposite of the Insert>Caption command with the advantage of not creating a frame.

I don’t see the point here. This is perhaps due to a confusion about the definition of “caption”. In Writer, as well in traditional typography, a caption is any text accompanying an object (image, side text, table, …). Numbering captions is a different optional matter. For the purpose of creating a table/index/list of captions with the same engine as TOC, Writer collects all paragraphs containing the same Number range (i.e. a counbter) as the one designated in Insert>TOC & Index>TOC, Index or Bibliography command.

Much more than you think. The correct but difficult way to tame frames is with frame styles. But as soon as you “touch” a frame with your mouse or cause it to move with arrow keys, you create a very sticky direct formatting (DF) condition. DF is a major cause of problems with text, but with frames it is an unmanageable nightmare because you can hardly get rid of it.

As already mentioned, a frame is an “escape mechanism” allowing to “detach” its content from text management. This implies no grouping at all. However, you can specify in the style a fixed relation of the frame relative to its anchor (@EarnestAl writes “You can lock the image’s position in the frame” but you don’t really lock it in the frame; you only lock the relative position to the anchor or rather a reference point related to the anchor – this is quite different). This replaces grouping provided you don’t fancy to move the frame manually, because this DF destroys the relationship.

Existing documentation does not insist enough on the danger of DF in general (people erroneously think DF is “intuitive”) and even less on its catastrophic destabilising effect on frames.

The only way out is frame styles. Unfortunately, they are extremely difficult to tame, perhaps because the concept has not been thought deeply enough.

To avoid the mentioned difficulties and also avoid to create DF, use frame styles. Not only your positioning will be more precise but you’ll have many more possibilities.

Unfortunately, it take years of experimenting and practising before you get confident enough to be able to design a predictable style on first trial.

Writer Offers the posibility of insert a Caption.

This Create a frame wiht the image and the caption.

May be a diret format but you can include borders to the frame that surround the caption text along with the image, and you can positionate the frame with the image and caption somewhere of the documentent with with a flow of text surrounding the frame.

  • This cannot be done with a caption paragraph unless you insert a rectangle which further complicates the layout and direct formatting.

You clearly describe the two use cases and the difference in design.

The “border” case is typical of side annotation of text where an ID is necessary to reference the annotation from the text and draw reader’s attention to it. Insert>Caption is intended for this.

The other case, illustration “embedded” in text using margin-to-margin area is more easily implemented without Insert>Caption. You create first the caption as a “manual” paragraph (inserting the same Number range as it would with the menu command) and you attach your image.

Choice between both approaches is a matter of taste or company/institution graphical charter.

All decorations (borders, colour, background, …) are available in both designs.

Don’t be fooled by the apparent simplicity of Insert>Caption. There is a lot of undocumented work behind the scene. For example, the apparent nesting of frames (or image in outer frame). As I mentioned, frames are independent from each other. Nesting is the result of an explicit computation of required size and position to simulate correct nesting. To demonstrate this is static, replace your inner image by another one with different size. You expect the outer frame to adapt to its contents (this works with text because text is truly internal to frame). Unfortunately, the result is catastrophic with the new image being randomly positioned, usually outside or overlapping borders. The reason is frames are not related to each other; a frame only owns text and never owns (contains) a frame. And this allows very interesting effects but IMHO defaults should have been configured differently for common users’ benefit.

You mean, implicitly, with the mouse. I know it is tempting and easy. But never do this. You introduce nightmarish direct formatting which ruins completely all automated self-adapting behaviour of frames.

You can use a frame with text and an image, surrounded by a border that serves as an illustration of that page without the need for a numbering sequence. This layout is used on many wiki pages, in newspaper headlines and in many travel guides.

I don’t understand how you can frame both an image and its caption with a border, when the caption is in an isolated paragraph.

You are assuming that I use the mouse to layout a document.
At no time have I indicated such a thing.
I know that adjusting objects in Writer is not intuitive and requires an understanding of how Writer handles them and a fair amount of experience.

It is a matter of configuring the paragraph style of the caption. There are various combinations of settings to do this among (vertical) spacing, indents, border padding, …

But usually a border is preferred in the frame case it better enhances the “detached” nature of the image+caption. When your layout is “inline” or “in-text” reading order, no border results in a nicer look.

Writer is versatile enough to accommodate 99.99% of the designs. And there are often several ways to achieve them. However, always choose the one with the simplest structure (it “hurts” Writer the least), i.e. minimal number of frames, tables or other non-text objects.