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

why ignore crossCheckDiagonal when NOT"PURE_BARCODE"

RelicOfTesla opened this issue · comments

Dose not work some picture.... Debug and found the diffrent run logic at this code

https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/qrcode/detector/FinderPatternFinder.java
line 516

...
public class FinderPatternFinder {
....
  protected final boolean handlePossibleCenter(
....
 if (!Float.isNaN(centerJ) && crossCheckDiagonal((int) centerI, (int) centerJ)) {

https://github.com/khanamiryan/php-qrcode-detector-decoder/blob/master/lib/Qrcode/Detector/FinderPatternFinder.php
line 231

class FinderPatternFinder
{
....
   final public function find($hints)
    {
....
        $pureBarcode = $hints != null && $hints['PURE_BARCODE'];
.... 
         if (!is_nan($centerJ) &&
                (!$pureBarcode || $this->crossCheckDiagonal((int)($centerI), (int)($centerJ), $stateCount[2], $stateCountTotal))
            ) {

Was skip some crossCheckDiagonal logic...and dose not work at some picture..