file_put_contents() is issuing an error when trying to export an image

前端 未结 4 948
攒了一身酷
攒了一身酷 2021-01-19 20:36

I have created an image by copying a number of images into a new one. In the last step of my program, I am trying to export this file into a folder.

The code is as

4条回答
  •  抹茶落季
    2021-01-19 20:50

    $export is going to be a GD image handle. It is NOT something you can simply dump out to a file and expect to get a JPG or PNG image..

    For that, you should be doing

    imagepng($export, "../pidjin/$bits etc...");
    

    which will create the .PNG file for you.

提交回复
热议问题