Google 的 pagespeed-insights API 提供的屏幕截图似乎分辨率很小。如何更改 PHP 中的分辨率
if($apc_is_loaded) {
apc_fetch("thumbnail:".$url, $use_cache);
}
if(!$use_cache) {
$screen_shot_json_data = file_get_contents("https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=$url&screenshot=true");
$screen_shot_result = json_decode($screen_shot_json_data, true);
$screen_shot = $screen_shot_result['screenshot']['data'];
if($apc_is_loaded) {
apc_add("thumbnail:".$url, $screen_shot, 2400);
}
}
$screen_shot = str_replace(array('_','-'), array('/', '+'), $screen_shot);
$screen_shot_image = "<img src=\"data:image/jpeg;base64,".$screen_shot."\" class='img-responsive img-thumbnail'/>";