/** * Add image size information. * * @param \Symfony\Component\HttpFoundation\File\UploadedFile $uploadedFile * @return File */ public function fromPost($uploadedFile) { if (!is_null($uploadedFile)) { parent::fromPost($uploadedFile); if ($this->isImage() && $this->hasFile($this->disk_name)) { list($width, $height) = getimagesize($uploadedFile->getRealPath()); $width and $this->image_width = $width; $height and $this->image_height = $height; } } return $this; }