PNG Transparency Resize with SimpleImage.php Class

前端 未结 4 1968
一个人的身影
一个人的身影 2020-12-05 08:51

I\'m using a modified version of the SimpleImage.php class: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php

The edits I found on phpfreaks (htt

4条回答
  •  生来不讨喜
    2020-12-05 09:16

    The function imagecreatetruecolor() does not work with GIF's. Use the imagecreate method instead:

    if($this->image_type == IMAGETYPE_GIF){
        $new_image = imagecreate( $Width, $Height ); // for gif files
    } else{
        $new_image = imagecreatetruecolor($Width, $Height); // for all other files
    }
    

提交回复
热议问题