Here's how I'm checking for the dimensions of an uploaded image. You could
similarly do the size as well.
<dtml-if "(_.int(_.getitem(_['tmpimageid'],1).getProperty('height')) > 150)
or (_.int(_.getitem(_['tmpimageid'],1).getProperty('width')) > 200)">
<B>Error:</B>your image is bigger than 200x150!
</dtml-if>