khanamiryan / php-qrcode-detector-decoder

This is a PHP library to detect and decode QR-codes. This is first and only QR code reader that works without extensions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Images with more than one qrcode do not work

steinm opened this issue · comments

If the image contains more than one qrcode it doesn't decode any of them.

114600906-barcode-and-qr-code-vector-set (1)

This is an example image which even causes a php fatal error due to an exhausted memory size

PHP Fatal error: Allowed memory size of 343932928 bytes exhausted (tried to allocate 268435464 bytes) in khanamiryan/qrcode-detector-decoder/lib/IMagickLuminanceSource.php on line 60

this is crazy. why would you decode such things? even phone and QR code scanners cannot read those all in our go. you need to cut this into many images and do some loops.

In case I'm wrong and you manage to pull this, please share. someone might need that. happy coding :-)

It might be crazy to decode this one, but it causes a fatal error because of its memory consumption. Other images show the same behaviour.

Zbarimg (a command line tool) is capable of finding and decoding several barcodes in one image returning one code per result line. Unfortunately it doesn't do the job very good (often not finding the bar codes). Unfortunately khanamiryan/php-qrcode-detector-decoder is not capable of detecting bar codes in larger images (like a png of a sheet of paper), one instance would take up more than 1 GB of RAM to process the image.

@benediktcarda This seems to a limitation of the Zxing platform that was ported to PHP here. Zxing can also only extract one bar code per image.