creating png files

后端 未结 3 1851
醉话见心
醉话见心 2021-02-15 00:44

I made a function to handle jpg and png files, but i get error when trying to upload a png file.

this is the function:

function createImg ($type, $src, $         


        
3条回答
  •  不思量自难忘°
    2021-02-15 01:13

    Johnny Craig's answer is correct except one thing, it has inverse relationship. 9 - is the most possible compression, and 0 - no compression, so the most possible quality.

    if ($type == 'png') {
        $quality = round((100 - $quality) * 0.09);
    }
    

提交回复
热议问题