private function getInfo()
{
$filename = $this->isLocal() ? APPLICATION_PATH . '/../' . $this->getPath() : $this->url;
if ($this->isLocal() && !file_exists($filename)) {
$this->setBroken();
return;
}
try {
$info = getimagesize($filename);
} catch (\Exception $e) {
$this->setBroken();
return;
}
if (!is_array($info) || empty($info[0]) || empty($info[1])) {
$this->setBroken();
return;
}
$this->width = (int) $info[0];
$this->height = (int) $info[1];
$this->saveEntity();
}