Ask Your Question

Fitting image in border but still keep ratio [closed]

asked 2017-08-31 13:27:50 +0100

Valkyrias gravatar image

updated 2020-07-12 00:01:25 +0100

Alex Kemp gravatar image

When I add a caption to an image it gains a border and some text underneath it. I want to have multiple pictures with the same border size. The problem is if I do it with different images of different sizes, the size of the border is, of course, different as well. And if I resize the border to fit the size I want it to be the image gets distorted and does not keep its ratio. Is there a way to automatically resize the image so it fits the border but still keeps its ratio? The image would then fit horizontally or vertically (or perfect if it has the same ratio as the border).

I already tried to add margins to the image inside the border but for all the images I have it would take very long and I think there must be a more elegant solution.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-10-14 10:56:51.142257

1 Answer

Sort by » oldest newest most voted

answered 2017-08-31 17:07:21 +0100

Grantler gravatar image

updated 2017-09-01 08:40:52 +0100

There is a little bit weird work around.

  1. Insert a picture, open the style manager (F11) > Graphics should should be selected/highlighted
  2. Modify the Graphics style this way: Width = 9 cm (or other); Height = [x] AutoSize. From now on the Graphics style can be applied to each inserted image/Caption frame (see points below)
  3. Insert any new image, it can be wider or slimmer than the chosen 9 cm
  4. Right click on the image (green handles/grip points): Insert Caption
  5. Frame (not image!) is selected (green handles/grip points): Double click on Graphics in the style manager
  6. Image (and frame) moves proportional to chosen width, as desired

Little bug: Between upper boundary of frame and image you have some little space. If there is not defined any border this mistake is not to be seen in the print preview or in the printout. If you define a border, so don't synchronize the distances; it is possible to diminish the bug (set the upper distance on 0, the other ones on ca 0,2 cm).

Tried on: LibreOffice

PS: I hope this is a "a more elegant solution" ;-)

PPS: An open question and - in my view - unsolved is the problem to save graphic and frame properties anchored "as character" in current file and within the default page style. The update style function seems to work roguely.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-08-31 13:27:50 +0100

Seen: 1,462 times

Last updated: Sep 01 '17