Jarves\Controller\Admin\FileController::appendImageInformation PHP Method

appendImageInformation() protected method

Adds image information (dimensions/imageType).
protected appendImageInformation ( array &$file )
$file array
    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]];
            }
        }
    }