PHP GD,imagecreatefromstring(); 如何获得图像尺寸?

Kas*_*per 11 php upload gd image

通常我会使用imagecreatefromjpeg(),然后getimagesize()使用Firefox 3,我需要绕过这个不同的.所以现在我正在使用imagecreatefromstring(),但我现在如何检索图像尺寸?

Phi*_*Lho 18

imagesx()imagesy()功能似乎也与使用的图像一起工作imagecreatefromstring().


Kas*_*per 7

没错!我刚才在互联网上找到了答案:)

对于那些仍然感兴趣的人:

$image = imagecreatefromstring($img_str);
$w = imagesx($image);
$h = imagesy($image);
Run Code Online (Sandbox Code Playgroud)