致命错误:未捕获的异常'异常'带消息' FPDF错误:不是JPEG文件

时间:2017-12-12 01:41:17

标签: php function pdf jpeg fpdf

这里是CODE.line no 62 https://pastebin.com/wTgeJjNR

// $ qus_img为空

        $qus_imga = "data:image/jpeg;base64,".base64_encode($qus_img);

        $pic = getImage($qus_imga);


       function getImage($dataURI)
         {
                $img = explode(',',$dataURI,2);
                $pic = 'data://text/plain;base64,'.$img[1];
                $type = explode("/", explode(':', substr($dataURI, 0, 
                strpos($dataURI, ';')))[1])[1]; // get the image type
                if ($type=="png"||$type=="jpeg"||$type=="gif") return 
                array($pic, $type);
                return false;
         }

0 个答案:

没有答案