Latex: Picture – scale/crop according to defined size – possible?

By | August 10, 2018

I'm facing a problem, for which I can't find a solution in any of the forums. Maybe one of you guys can help...

For a project, I need one page with images, that all are there in a specific size and ratio of width/length. This page will be reused within the project several times. Now, the problem is, that obviously the images do not always have the same ratio of width&length as do those spaces they should fit in.

What we would like to do, since this is a "layout" page that is reused, is to:

  1. List item
  2. Define the boxes/spaces/dimensions of the image (as part of a whole layout, but anyway this is no problem to do).
  3. One we want to insert an image, this image should be scaled down to e.g. the width of this box (no problem to do), but then with currently, either the height is changed, or we loose the ratio of the image.

Therefore we would like to have a third step: 3. Auto-trimming/cropping the part of the image that are out of the box, so the image fits inside. And that kind of where we struggle for all images except those that are an exact square (but this is useless, because most image spaces will not be exact squares).

We are aware of the Photobook document style, but as this is only one (repeated) page in a Hugh document we would rather have a different solution.

Thanks a lot in advance for your help!