【问题标题】:PHP GD, imagecreatefromstring( ); how to get the image dimensions?PHP GD, imagecreatefromstring();如何获得图像尺寸?
【发布时间】:2010-09-11 16:09:39
【问题描述】:

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

【问题讨论】:

    标签: php image upload gd


    【解决方案1】:

    imagesx()imagesy() 函数似乎也适用于使用 imagecreatefromstring() 制作的图像。

    【讨论】:

      【解决方案2】:

      啊,是的!我刚刚在互联网上找到了答案:)

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

      $image = imagecreatefromstring($img_str);
      $w = imagesx($image);
      $h = imagesy($image);
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-03-07
        • 2023-03-08
        • 1970-01-01
        • 2015-09-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多