Crop image in circle (php)

后端 未结 3 1782
长情又很酷
长情又很酷 2021-02-06 05:28

The following code works on my laptop but doesn\'t work on remote server:



        
相关标签:
3条回答
  • 2021-02-06 06:00

    I think you might have problems with filepath. Check if pathinfo returns valid extension and add after $filename declaration something to check if it exists and is readable

    if(!is_file($file) || !is_readable($file)){ die('Readable file not found');}
    
    0 讨论(0)
  • 2021-02-06 06:02

    Changed the line:

    imagecopy($image, $mask, 0, 0, 0, 0, $newwidth, $newheight);
    

    to:

    imagecopymerge($image, $mask, 0, 0, 0, 0, $newwidth, $newheight,100);
    
    0 讨论(0)
  • 2021-02-06 06:02

    I think a basic reading of how to debug http://blog.regehr.org/archives/199 would be useful to you, and help you to solve your problem

    0 讨论(0)
提交回复
热议问题