I don't think users should set the size of images. The native resolution couple with a max-width:100% rule in CSS should work well enough for pretty much every realistic use.
That said, it's possible (if tedious) to modify the normal IMG tag and its template to allow specifying dimensions, and use a custom parser to implement that syntax or something close to it. I'm leaving this as a proof of concept:
$tag = $configurator->tags['img'];
$dom = $tag->template->asDOM();
$img = $dom->getElementsByTagName('img')->item(0);
foreach (['height', 'width'] as $attrName)
{
$attribute = $tag->attributes->add($attrName);
$attribute->required = false;
$attribute->filterChain[] = '#uint';
$img->appendChild($dom->createElementNS('http://www.w3.org/1999/XSL/Transform', 'xsl:copy-of'))
->setAttribute('select', '@' . $attrName);
}
$dom->saveChanges();
$configurator->Preg->match(
'/!\\[(?<alt>[^]]*)\\]\\((?<src>\\S+)\\s+=(?<width>\\d+)x(?<height>\\d+)\\)/',
'IMG'
);