84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
跨域请求的图片,需要在php中,如下操作base64编码后,img的src引用编码就可以完成类似getImageData的操作$pic = 'a.jpg';$arr = getimagesize($pic);$pic = "data:{$arr['mime']};base64," . base64_encode(file_get_contents($pic));?>问题是图片分辨率2k,加载很慢,现在就想请教大神们,php怎么可以先压缩图片大小在进行编码,输出使用?
学习是最好的投资!
貌似有 imagecopyresampled 函数
就和你平时压缩图片一样。。看是要裁剪还是降低质量,然后再base64
貌似有 imagecopyresampled 函数
就和你平时压缩图片一样。。看是要裁剪还是降低质量,然后再base64