public static function imageSizeFromString($imagedata, &$imageinfo = null)
    {
        $uri = 'data://application/octet-stream;base64,'.\base64_encode($imagedata);
        if ($imageinfo !== null) {
            return \getimagesize($uri, $imageinfo);
        }
        return \getimagesize($uri);
    }