If I understand correctly your question, your document contains captioned images. Structurally, this translate to a text frame (the caption) containing a nested frame (the image). But default, these frames are AutoSize, meaning the size of the image dictates the Graphics frame size which in turn dictates the Frame frame size.
But it seems you want it the other way round, i.e. changing the outer frame size to cause the image to shrink or expand.
This is usually what happens when you drag the frame handle.
However, it seems there is a bug (?) or non-documented behaviour when you paste or otherwise replace the image directly, even if both height and width are AutoSize.
From experimentation, it looks like the outer frame keeps its width when the image is replaced. Then if the new image scaled to width:
- is taller than the replaced one, the caption frame expands vertically
- is shorter than the replaced image, the caption frame keeps its height.
Reapplying the frame style does nothing because the Height (at least) parameter kept its previous value. This parameter overrides (or complements) AutoSize. This parameter is set frame per frame and can be considered direct formatting which explains why reapplying the frame style has no effect. But this is not common direct formatting and
M has no effect either.
The only workaround I could find was to apply another frame style and then Frame again. It seems that Marginalia resets enough parameters to do the trick.
Note that anchors play no role here.
- define your own frame styles or tune built-in Frame and Graphics (so that you format your illustrations and captions with a double-click on the style name – refrain from adding manual properties)
- make sure all your frames are AutoSize
- replace your picture
- apply frame style Marginalia
- reapply the original frame style to the caption frame (by default Frame)
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!
In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.