I have been trying to a achieve in ConTeXt what's called "Auto-Fit" in Adobe InDesign, specifically the "Fill Frame Proportionally" kind of Auto-Fit. And from what I gather from the description in ConTeXt Garden this should be possible. Unfortunately, however, I haven't been able to make it work, which is why I would like to ask for help.
Here's a MWE (btw, this resembles an older question discussed here):
\setuppapersize[A4][A4]
\setuplayout
[
backspace=11.67mm, width=131.25mm,
topspace=21.21mm, height=254.57mm,
headerdistance=13pt, header=13pt,
footerdistance=13pt, footer=13pt,
rightmargindistance=13pt, rightmargin=39.5mm,
]
\setuppagenumbering[alternative=doublesided, location=]
\definehead[PageSection][section]
\setuphead[PageSection][
page=right,
continue=no,
style=\ssb\bf,
]
\starttext
\chapter{Testing Proportional Fitting}
\dorecurse{3}{\input{knuth}}
\placefigure[leftpage,none]{}
{\externalfigure[http://www.hardwickagriculture.org/blog/wp-content/uploads/placeholder.jpg] [
width=\textwidth,
height=\textheight,
]}
\PageSection{Here's a Section on a New Page}
\dorecurse{3}{\input{knuth}}
\stoptext
And this is what it looks like:
As you can see, the image is scaled to the size of the type area, which is almost what I want. I would like for the image to scale proportionally, though (and be cropped as necessary). So, I did some research and found the parameter factor: max
here, which seems to be perfectly suited ("aspect ratio is kept, the image is scaled to the bigger (oversized) variant"). However, the result of adding the parameter...
\placefigure[leftpage,none]{}
{\externalfigure[http://www.hardwickagriculture.org/blog/wp-content/uploads/placeholder.jpg] [
width=\textwidth,
height=\textheight,
factor=max,
]}
is this:
Indeed, the image is scaling proportionally now, but it's not filling the frame anymore. So, I thought, I must have misunderstood the meaning of the factor
and also tried factor: fit
. Surprisingly, the result is exactly the same (i.e. no difference).
Can anybody offer any ideas as to how to achieve this? Am I on the right track trying the factor parameter? Is this a bug? Or are there other solutions?
Thanks in advance for any help.
factor: max
was supposed to do exactly that and thought that I had found a bug. Now, judging from the last paragraph in the thread ("We should convince Hans to add this functionality (...) with factor=clip") I am wrong. Do you happen to know, is this is being worked on?