protected function appendImageInformation(&$file)
{
$imageTypes = array('jpg', 'jpeg', 'png', 'bmp', 'gif');
if (array_search($file['extension'], $imageTypes) !== false) {
$content = $this->webFilesystem->read($file['path']);
$size = new FileSize();
$size->setHandleFromBinary($content);
$file['imageType'] = $size->getType();
$size = $size->getSize();
if ($size) {
$file['dimensions'] = ['width' => $size[0], 'height' => $size[1]];
}
}
}