public function getImageInfo($image)
    {
        if ( empty($image) || !file_exists($image))
        {
            throw new \InvalidArgumentException('Image file not found.');
        }

        $pathInfo = pathinfo($image);
        $info     = getimagesize($image);

        if ( !in_array($pathInfo['extension'], $this->types) )
        {
            throw new \InvalidArgumentException('Unsupported image file extension.');
        }

        $info['width']    = $info[0];
        $info['height']   = $info[1];
        $info['ext']      = $info['type'] = $pathInfo['extension'];
        $info['size']     = filesize($image);
        $info['dir']      = $pathInfo['dirname'];
        $info['path']     = str_replace('/', DIRECTORY_SEPARATOR, $image);
        $info['fullname'] = $pathInfo['basename'];
        $info['filename'] = $pathInfo['filename'];
        $info['type']     = ($info['type'] == 'jpg') ? 'jpeg' : $info['type'];

        return $info;
    }
public function getImageInfo($image)
    {
        if ( empty($image) || !file_exists($image))
        {
            throw new \InvalidArgumentException('Image file not found.');
        }

        $pathInfo = pathinfo($image);
        $info     = getimagesize($image);

        if ( !in_array($pathInfo['extension'], $this->types) )
        {
            throw new \InvalidArgumentException('Unsupported image file extension.');
        }

        $info['width']    = $info[0];
        $info['height']   = $info[1];
        $info['ext']      = $info['type'] = $pathInfo['extension'];
        $info['size']     = filesize($image);
        $info['dir']      = $pathInfo['dirname'];
        $info['path']     = str_replace('/', DIRECTORY_SEPARATOR, $image);
        $info['fullname'] = $pathInfo['basename'];
        $info['filename'] = $pathInfo['filename'];
        $info['type']     = ($info['type'] == 'jpg') ? 'jpeg' : $info['type'];

        return $info;
    }
public function getImageInfo ( $ image ) { if ( empty ( $ image ) || ! file_exists ( $ image ) ) { throw new \ InvalidArgumentException ( 'Image file not found.' ) ; } $ pathInfo = pathinfo ( $ image ) ; $ info = getimagesize ( $ image ) ; if ( ! in_array ( $ pathInfo [ 'extension' ] , $ this -> types ) ) { throw new \ InvalidArgumentException ( 'Unsupported image file extension.' ) ; } $ info [ 'width' ] = $ info [ 0 ] ; $ info [ 'height' ] = $ info [ 1 ] ; $ info [ 'ext' ] = $ info [ 'type' ] = $ pathInfo [ 'extension' ] ; $ info [ 'size' ] = filesize ( $ image ) ; $ info [ 'dir' ] = $ pathInfo [ 'dirname' ] ; $ info [ 'path' ] = str_replace ( '/' , DIRECTORY_SEPARATOR , $ image ) ; $ info [ 'fullname' ] = $ pathInfo [ 'basename' ] ; $ info [ 'filename' ] = $ pathInfo [ 'filename' ] ; $ info [ 'type' ] = ( $ info [ 'type' ] == 'jpg' ) ? 'jpeg' : $ info [ 'type' ] ; return $ info ; }
Get image info array

@param string $image
@return array
Get image info array