kxh's avatar
Level 1

Laravel image intervention- getPathname is not available for driver

Hi guys IM working with an ocr website where users will upload images of fifa 21 match results. I want the ocr to parse a selected area of image and i wrote a function with laravel intrevention to crop the image when uploaded Here is the code

public function readImage(Request $request)
    {
        $image =Image::make($request->file('image'));
        $mime = $image->mime();
        $mime_object = new \Mimey\MimeTypes;
        $extension = $mime_object->getExtension($mime);

        $image->crop(610,343,405,112);
        $image->save('test.jpg', 60);


        if (isset($image) && $image->getPathName()) {
            $ocr = app()->make(OcrAbstract::class);


            $parsedText = $ocr->scan($image->getPathName());
            return view('ocr', compact('parsedText'));

        }

    }

But when i try to parse the image it shows me this error

Intervention\Image\Exception\NotSupportedException
Command (GetPathName) is not available for driver (Gd).

Where am I going wrong in the code? Can someone help me. Thank you in advance

0 likes
0 replies

Please or to participate in this conversation.