# How to suppress units such that they can be passed to viewport key?

How to suppress units in length macros such that they can be passed to viewport. See the following Minimal Not Working Example,

\documentclass{article}
\usepackage{graphicx}
\newsavebox\IBox
\savebox\IBox{\includegraphics{bald}}
\newdimen\width
\newdimen\height
\width=\wd\IBox
\height=\ht\IBox
\parindent=0bp
\begin{document}
\makeatletter
\includegraphics[viewport=0 0 \strip@pt\width \strip@pt\height]{bald}
\makeatother
\end{document}

-
Note that \width and \height are often used temporally by macros like \raisebox and then set to the content size. It's not an issue here, I just want to point that out. I'm planning to add this to \includegraphics in the next feature release of adjustbox. –  Martin Scharrer Jul 12 '11 at 9:37
@Martin: Can you give me an example where \width and \height will affect \raisebox in a practical situation? –  xport Jul 12 '11 at 14:09

The viewport option actually accepts units, but defaults to bp if none are used. The issue here is that the macro is eating the space behind it which is used as a separator by viewport (and also trim). The solution is to wrap the expression in { } (which is removed afterwards) to protect the space:
\includegraphics[viewport=0 0 {\width} \height]{bald}