pub fn parse_graphicx_options(options: &str) -> Vec<GraphicxOp>Expand description
Compile a graphicx option string into the transformation sequence.
Port of Perl image_graphicx_parse (Util/Image.pm L142-196). Key order
matters and is Perl’s, in two ways:
- A rotation is applied before scaling when no sizing option preceded
the
anglein the source string, and after it otherwise. Perl decides this the instant it parsesangle($rotfirst = !($width || $height || $xscale || $yscale), L168), from the keys seen so far — soangle=90,width=100ptrotates then scales, whilewidth=100pt,angle=90scales then rotates. graphicx really behaves this way and pdflatex agrees: the first is ~100x200, the second ~50x100 for a 200x100 source. We capturerot_firstat the same point, not from the final key set.
pc differs from Perl by design: Perl’s table has pc => 12/72.27, which
is 12 TeX pt expressed in bp only if you also drop the pt→bp step — a pica
is 12 pt, so the factor is 12 * 72/72.27. Perl’s value makes a 1pc box
0.166bp instead of 11.955bp. Ours is the correct one; no test in the corpus
exercised pc.