![](https://secure.gravatar.com/avatar/db7529b4374a5a6746650c649b9dcdb6.jpg?s=120&d=mm&r=g)
Hello list members: I would like to make a photo montage (4x3 images on one page) using \placefigure, \externalfigure and combinations. The images should be scaled to the same size, eg to .25\textwith and .3\textheight so that the aspect ratios of the images are kept and the appropriate value is used for width or height. That is the smaller value from .25\textwith and .3\textheight is used for the image size. Using only \useexternalfigure[Fig1][1.jpg][width=.25\textwidth] may not give the correct result if the image requires size adjustment by height and vice versa. Defining both width and height results in exact resizing and the aspect ratio is not maintained. How can this be solved? Thanks, bcsikos
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 5/9/2015 10:26 PM, Csikos Bela wrote:
Hello list members:
I would like to make a photo montage (4x3 images on one page) using \placefigure, \externalfigure and combinations. The images should be scaled to the same size, eg to .25\textwith and .3\textheight so that the aspect ratios of the images are kept and the appropriate value is used for width or height. That is the smaller value from .25\textwith and .3\textheight is used for the image size.
Using only \useexternalfigure[Fig1][1.jpg][width=.25\textwidth] may not give the correct result if the image requires size adjustment by height and vice versa. Defining both width and height results in exact resizing and the aspect ratio is not maintained.
How can this be solved?
\useMPlibrary[dum] \showframe \starttext \setuplayout[middle] \defineexternalfigure[quarter][factor=max] \vbox{\dorecurse{4}{\hbox{\hsize.25\textwidth\vsize.25\textheight\dorecurse{4}{\externalfigure[dummy][quarter]}}}} \page \setuppapersize[A4,landscape] \setuplayout[middle] \vbox{\dorecurse{4}{\hbox{\hsize.25\textwidth\vsize.25\textheight\dorecurse{4}{\externalfigure[dummy][quarter]}}}} \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/cedc4d83943006afe3994fb0a0455f82.jpg?s=120&d=mm&r=g)
On Sat, May 09 2015, Csikos Bela wrote:
\placefigure, \externalfigure and combinations. The images should be scaled to the same size, eg to .25\textwith and .3\textheight so that the aspect ratios of the images are kept and the appropriate value is used for width or height.
What is the "appropriate" value?
That is the smaller value from .25\textwith and .3\textheight is used for the image size.
"The smaller value from .25\textwith and .3\textheight" does only depend on the layout, but not on the image. This is perhaps, what you need: maxwidth=..., maxheight=... -- Peter
![](https://secure.gravatar.com/avatar/db7529b4374a5a6746650c649b9dcdb6.jpg?s=120&d=mm&r=g)
"Peter Münster" írta:
On Sat, May 09 2015, Csikos Bela wrote:
\placefigure, \externalfigure and combinations. The images should be scaled to the same size, eg to .25\textwith and .3\textheight so that the aspect ratios of the images are kept and the appropriate value is used for width or height.
What is the "appropriate" value?
The calculated value which pairs with < or = to the other calculated value. For example if the height calculated for .25\textwidth is less than .3\textheight then .25\textwidth else .3\textheight should be used for calculating the size of the image.
That is the smaller value from .25\textwith and .3\textheight is used for the image size.
"The smaller value from .25\textwith and .3\textheight" does only depend on the layout, but not on the image.
Of course, but the layout determines how the images has to be scaled.
This is perhaps, what you need: maxwidth=..., maxheight=...
Exactly, this is what I need. Thanks, bcsikos
participants (3)
-
Csikos Bela
-
Hans Hagen
-
Peter Münster