有没有办法使用 imagecreatefromstring()
并以某种方式获取图像类型?
最佳答案
当您使用 imagecreatefrom... 方法时,图像将作为未压缩的位图加载到内存中。此时并没有真正的图像类型。您可以使用图像...功能将其保存为您希望的任何类型。
$img = imagecreatefromstring($data);
imagepng($img, "file path and name");
imagedestroy($img);
http://us2.php.net/manual/en/function.imagecreatefromstring.php
关于php gd imagecreatefromstring() 和图像 mime 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7175883/