I would like to scale an included graphics keeping its aspect ratio. Using
\includegraphics[width=<my width>,height=<my height>,keepaspectratio]{file.jpg}
scaling naturally takes place, but the package calculates which scaling factor is the lower one, the factor to achieve the given width or the factor to achieve the given height (while observing the aspect ratio). That makes sense if you have a given dimension to fill and would like to make sure that the image is fully shown.
However, I would like to scale using the larger of the two scaling factors. In effect, this would fully fill the given dimensions and produce an overlap either in width or height.
In a next step, I then would like to use the adjustbox to clip the viewport to my desired dimensions, ideally centered on the image. But that's potentially stuff for a separate question.
Edit with solution
Martin essentially answered the question, so the credit is his.
Here, I'd only like to share the actual code I used based on Martin's suggestion. My target width and height are called \mywidth and \myheight respectively.
\adjustbox{%
min size={\mywidth}{\myheight},%
Clip*={0.5\width - 0.5\mywidth} {0.5\totalheight - 0.5\myheight}%
{0.5\width + 0.5\mywidth} {0.5\totalheight + 0.5\myheight}%
}{%
\includegraphics[max size={\mywidth}{\myheight}]{file.jpg}%
}%
To get the adjustbox options working with includegraphics I used the export option of the package.

min widthandmin heightconstraints are satisfied and nothing is scaled. I cannot use themax widthormax heightconstrains as only one of them will apply, but I don't know which one that is ex-ante. So in a way aminmax sizeoption is missing, that scales down to satisfy the max constraints and then up again to satisfy both min constraints. Or am I missing something? – kongo09 Aug 17 '11 at 21:49max sizewith a smaller size to ensure it is scaled down if required and thenmin sizeas shown. This is basically the same you mentioned about theminmax sizekey. – Martin Scharrer Aug 17 '11 at 21:54