I'm trying to do something similar for the 'angle' key. I want to compute the rotation angle in a macro. The example below is a bare skeleton, but it doesn't work.
\documentclass{article} \usepackage{graphicx} \usepackage{calc} \usepackage{ifthen} \begin{document} % this works \includegraphics ...