Resizing with GD outputs black images

前端 未结 4 1078
抹茶落季
抹茶落季 2021-01-17 07:35

What can cause php gd to produce a black image after resizing? The following code always outputs a black image for every valid jpeg file.



        
4条回答
  •  自闭症患者
    2021-01-17 08:16

    Ensure gd is installed and enabled.

    To check, create a PHP file with this command:

    Access the file through a browser and scroll down to the gd section. If gd isn't there, or it is disabled, add it with yum, apt-get or the Windows equivalent.

    You also need the GD library available (http://www.libgd.org/).

    Consider switching to IMagick (http://php.net/manual/en/book.imagick.php) for better image quality.

提交回复
热议问题