The class resizes images and prepares data for the element.
Usage:
$picture = new Picture(new File('example.jpg'));
$data = $picture
->setImportantPart(array('x'=>10, 'y'=>10, 'width'=>100, 'height'=>100))
->setImageSize(ImageSizeModel::findByPk(1))
->setImageSizeItems(ImageSizeItemModel::findVisibleByPid(1, array('order'=>'sorting ASC')))
->getTemplateData()
;
Shortcut
$data = Picture::create('example.jpg', 1)->getTemplateData();
$data = Picture::create('example.jpg', array(100, 100, 'crop'))->getTemplateData();