Convert image format PNG to JPEG without saving to disk - PHP

后端 未结 2 1044
春和景丽
春和景丽 2020-12-21 13:28
  • I am taking a PNG image from a url as below.
  • I want to convert the PNG image to JPEG without saving disk with PHP.
  • Finally I want to assign JPEG

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-21 13:49

    You want to use the gd library for this. Here's an example which will take a png image and output a jpeg one. If the image is transparent, the transparency will be rendered as white instead.

    
    

提交回复
热议问题