5
有没有办法使用imagecreatefromstring()
并得到某种方式什么是图像类型?php gd imagecreatefromstring()和图像MIME类型
有没有办法使用imagecreatefromstring()
并得到某种方式什么是图像类型?php gd imagecreatefromstring()和图像MIME类型
当您使用imagecreatefrom ...方法时,图像将作为未压缩的位图加载到内存中。此时并没有真正的图像类型。您可以将其保存为您希望使用图像...功能的任何类型。
$img = imagecreatefromstring($data);
imagepng($img, "file path and name");
imagedestroy($img);
http://us2.php.net/manual/en/function.imagecreatefromstring.php
确定,但从检测的onload点有什么样的? – Marcin
你试图达到的最终目标是什么?你是否希望确定你所加载的内容实际上是一张图片还是你真的需要知道加载的图片的确切类型? – Bueller