Am 07.02.2026 um 02:35 schrieb Jim:
On Fri, Feb  6, 2026 at 10:01 (+0100), Henning Hraban Ramm wrote:

Hi again,

I tried to make sense of the scaling factor options and can’t believe that
they work as intended.

* default = min: width and height observed, image distorted
(good for default, probably wrong for min)
* fit = auto: proportional scaling, should fill available space as possible,
but behaves sometimes as "max"
* max = prop. scaling to use bigger side of the image, can exceed height
* broad = prop. shrinking that I can’t understand

Find an example attached where I tried to find out what’s going on.

I was wondering whether there are
(1) "works as intended" problems or
(2) documentation in wiki is wrong.
Or maybe both.  Who's to say?

Attached is a different example which may clear things up completely.

Sorry, no Lua, and horrible brute-force code TeX.  More sensitive ConTeXt
users may only want to look at the PDF. ;-)


Don't mess with figure dimensions when you want the same aspect ration after scaling.

The min factor was added to add images which fill a fixed size area with an image which has a similar aspect ration as the area to be filled, anything which extends beyond the area can be removed with \clip.

The firt and max factors on the other hand stay withing a fixed sized area and leave whitespace on one of the sides.

\setupexternalfigures[location=default]

\setuppapersize[A4][A4,oversized]
\setuplayout[location=middle]

\showframe

\starttext

\startpagemakeup
\centerbox{\scale[factor=min]{\externalfigure[mill]}}%
\stoppagemakeup

\startpagemakeup
\clip[width=1pw,height=1ph]{\centerbox{\scale[factor=min]{\externalfigure[mill]}}}%
\stoppagemakeup

\stoptext

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to