![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
Am 30.03.24 um 03:15 schrieb Joel via ntg-context:
I have code like this:
\placefigure[here, force]{my caption}{% \externalfigure[#1][frame=on, maxheight=1.2\textwidth, maxwidth=\textwidth]% }%
I need some images to appear in a book. I need them to keep their proper ratios, but scale up to the maximize the available space.
The image can't be more than \textwidth wide, and can't ever be more than 1.2\textwidth high.
The problem I am getting with this code, and it does seem to be limiting the images to be not bigger than those two dimensions above, is some of the images, for reasons I can't understand, are appearing really tiny and aren't scaling up to fill as much space as is possible. I can't explain why this is happening--the images themselves are very very high resolution.
Is there any way to modify the code to make sure the image stretches up to be the biggest it can, without exceeding the sizes I've listed?
Hi Joel, AFAIK, if you don’t set at least either height or width, ConTeXt uses the image’s resolution setting to calculate its size, and that is often useless. (Maybe there’s also something wrong with ConTeXt’s max width/height, I don’t know; I’m still planning to carefully check all options of image processing…) You could try if "factor=fit" or "factor=max" yields the results you want. Hraban