In order to get a figure made by two different size images automatically scaled to the same height and to full text width, with a single caption, I tried to adapt some examples from floatrow package. Unfortunately, as shown by the following MWE, the results were unsatisfactory. In one case the caption is missing, in the other there is no separation between the two images.
\documentclass{article}
\usepackage{mwe}
\usepackage{floatrow}
\begin{document}
\begin{figure}[htb]
\CommonHeightRow{\begin{floatrow}
\ffigbox[\FBwidth]{\includegraphics[height=\CommonHeight]{example-image-16x10}}{}
\ffigbox[\FBwidth]{\includegraphics[height=\CommonHeight]{example-image-10x16}}{}
\end{floatrow}}
\caption{This is a caption.}
\end{figure}
\blindtext
\begin{figure}[htb]
\CommonHeightRow{\begin{floatrow}
\ffigbox[\FBwidth]{\includegraphics[height=\CommonHeight]{example-image-16x10}}{\includegraphics[height=\CommonHeight]{example-image-10x16}}
\end{floatrow}}
\caption{This is a caption.}
\end{figure}
\end{document}
I know that there are many ways to obtain the desired result, but I found none, apart from floatrow, able to automatically scale two different size images to same height and full text width.
Thanks in advance for any help.
Follow up
To summarize, a great solution to obtain automatically scaled double image figures that addittionally let you choose the total width (90% of text width in the following snippet) can be
\newlength\mylength
\begin{adjustbox}{width=0.9\textwidth,center=\textwidth,caption={This is a caption.},label={some:label},figure=htb}
\adjustimage{gstore height=\mylength}{example-image-16x10}%
\hspace{1em}%
\adjustimage{height=\mylength}{example-image-10x16}%
\end{adjustbox}%
which has the only drawback that separation between images changes slightly depending on images aspect ratio (other solutions addressing such drawback are welcome!). If you absolutely want a fixed separation you can stick with a more traditional solution in which you have to manually set the height, usually by iterative tentatives:
\begin{figure}[htb]
\centering
\includegraphics[height=0.4\textwidth]{example-image-16x10}%
\hspace{1em}%
\includegraphics[height=0.4\textwidth]{example-image-10x16}%
\caption{This is a caption.}%
\label{some:label}%
\end{figure}



example-image-aandexample-image-b(and others) for code examples. These are provided by themwepackage on CTAN. This way others can easily compile your code examples without the need for thedemooption. – Martin Scharrer Apr 17 '18 at 09:55example-image-16x10andexample-image-10x16. Seemwepackage for more details. – Martin Scharrer Apr 17 '18 at 09:59