我使用下面的代码来显示图像在输出上更改php base64_decode分辨率?
$imgstring = file_get_contents("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=".$_GET['url']."&screenshot=true");
$imgstring = json_decode($imgstring);
$imgstring = $imgstring->screenshot->data;
$imgstring = str_replace("_", "/", $imgstring);
$imgstring = str_replace("-", "+", $imgstring);
header('Content-Type: image/png');
echo base64_decode($imgstring);
我想知道是否有可能扩大或改变图像的尺寸显示在网页上之前。由于Google Insight图像本身只有320x240,因此我需要将其扩展为例如600x600。
感谢您的帮助/输入。
对于这一点,你就需要对图像进行解码,并创建该图像一个新的,无论是使用GD或Imagick或相似。您只能通过回显数据来“放大”图像。 –