为什么imageinterlace不工作?

时间:2018-02-23 15:10:12

标签: php

我创建了一个从html5画布上传裁剪图像的函数,该函数运行正常。我唯一的问题是imageinterlace函数没有创建 一个进步的jpeg。

if (is_uploaded_file($_FILES['image_file']['tmp_name'])) {
    $tmp_name = $folder . $new_name;
    move_uploaded_file($_FILES['image_file']['tmp_name'], $tmp_name);
    if (file_exists($tmp_name) && filesize($tmp_name) > 0) {
        $size = getimagesize($tmp_name);
        switch($size[2]) {
            case IMAGETYPE_JPEG:
                $ext = '.jpg';
                $v_image = @imagecreatefromjpeg($tmp_name);
                break;
            default:
                return false;
        }
        imageinterlace($v_image, 1);
        $destination_image = @imagecreatetruecolor( $request['width'], $request['height'] );
        imagecopyresampled($destination_image, $v_image, 0, 0, (int)$request['x1'], (int)$request['y1'], (int)$request['width'], (int)$request['height'], (int)$request['w'], (int)$request['h']);
        $result_name = $tmp_name . $ext;
        imagejpeg($destination_image, $result_name, 90);
    }
}

我做错了什么?

0 个答案:

没有答案