Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined offset: 1 $QRCodeReader->decode(base64_encode #9

Open
zanjs opened this issue Jul 18, 2017 · 2 comments
Open

Undefined offset: 1 $QRCodeReader->decode(base64_encode #9

zanjs opened this issue Jul 18, 2017 · 2 comments

Comments

@zanjs
Copy link

zanjs commented Jul 18, 2017

$content = $this->qrcode($token,$path.$id);

$QRCodeReader = new QRCodeReader();
$qrcode_text = $QRCodeReader->decode(base64_encode($content));

var_dump($qrcode_text);

_20170718222801

@yorb1990
Copy link

yorb1990 commented May 3, 2018

is un error in te file ../lib/QrReader.php in the line 61 inner file , the solution is add this extra prosess:

for($i=0;$i<count($imageDetails);$i++)
                {
                    if(preg_match("/^[0-9]+(x)[0-9]+$/",trim($imageDetails[$i]))>0){
                        $imageSize = explode('x', trim($imageDetails[$i]))  ;
                        break;
                    }
                }

also the call function $QRCodeReader->decode(base64_encode($content)); is

$QRCodeReader = new \Libern\QRCodeReader\QRCodeReader();
        $qrcode_text = $QRCodeReader->decode($request->input('img'));
        return \Response::json($qrcode_text);

example

image (example convert in base64)

Imgur

code

Imgur

execution

NOTE: the execution is by web API with base64 imag, call with "REST CLIENT" from google chrome

@libern
Copy link
Owner

libern commented May 7, 2018

A pull request is welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants