Código PHP:
public $minWidth;
public $maxWidth;
public function validateFoto($object,$attribute)
{
$info=getimagesize($_FILES[$attribute]['tmp_name']);
if (isset($this->minWidth)) {
if ($info[0] < $this->minWidth)
{
$message=$this->minWidthError ? $this->minWidthError : Yii::t('yii','Photo should be at least {width}px in width');
$this->addError($object,$attribute,$message,array('{width}'=>$this->minWidth));
}
}
if (isset($this->maxWidth)) {
if ($info[0] > $this->maxWidth)
{
$message=$this->maxWidthError ? $this->maxWidthError : Yii::t('yii','Photo should be at max {width}px in width');
$this->addError($object,$attribute,$message,array('{width}'=>$this->maxWidth));
}
}
}
En la function rule agrego
array('imagen','validateFoto','minWidth' => 110,'maxWidth' => 110),