旋转时的Gif黑色背景

时间:2013-09-09 17:31:23

标签: php gif

那么如何使用PHP:s imagerotate旋转GIF图像而不使图像出现黑色背景?

我已经尝试了几个小时但它仍然无法工作。这是我得到的信息:

        $degrees = 90.0;

        if($size['mime'] == 'image/gif') {
            $rotate = imagecreatefromgif($viewFile);
            $rotate = imagerotate($rotate, $degrees, imagecolorallocatealpha($rotate, 0, 0, 0, 127), 0);
            imagealphablending($rotate, false);
            imagesavealpha($rotate, true);
            if ($rotate != false) {
                imagegif($rotate, $viewFile, 100);
            }
            else {
                exit();
            }
        }

我已经尝试了所有我能想到的基于此... PNG文件运行良好,它只是GIF:s不能工作。

0 个答案:

没有答案
相关问题