PHP GD,imagecreatefromstring();如何获得图像尺寸?
题
通常我使用 imagecreatefromjpeg()
然后 getimagesize()
,但是使用Firefox 3我需要绕过这个不同的东西。所以现在我使用 imagecreatefromstring()
,但我现在如何检索图像尺寸?
解决方案
imagesx()
和 imagesy()
函数似乎也适用于使用 imagecreatefromstring()
制作的图像。
其他提示
是啊啊啊!我刚刚在互联网上找到了答案:)
对于那些仍然感兴趣的人:
$image = imagecreatefromstring($img_str);
$w = imagesx($image);
$h = imagesy($image);
不隶属于 StackOverflow