How can I validate image properties(heigth, width) in Kohana 3 before resize? Or how can I use image resizing only if my image do not less size what I need?
What I want to do: during avatar uploading I must resize image if it bigger that i want. Or take action to prohibit uploading bigger avatar.
Now I have this rules:
public function avatar_validate($files)
{
return Validate::factory($files)
->rules('avatar', array(
'Upload::valid' => NULL,
'Upload::type' => array(array('jpg','png','gif','bmp','gif')),
'Upload::size' => array('3M')
)
);
}