Skip to content

Commit e4ee47e

Browse files
committed
Merge commit 'refs/pull/53/head' of github.com:khanamiryan/php-qrcode-detector-decoder
2 parents 7df652d + 838c45a commit e4ee47e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/QrReader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ public function __construct($imgSource, $sourceType = QrReader::SOURCE_TYPE_FILE
7474
$this->reader = new QRCodeReader();
7575
}
7676

77-
public function decode()
77+
public function decode($hints = null)
7878
{
7979
try {
80-
$this->result = $this->reader->decode($this->bitmap);
80+
$this->result = $this->reader->decode($this->bitmap, $hints);
8181
} catch (NotFoundException $er) {
8282
$this->result = false;
8383
} catch (FormatException $er) {
@@ -87,9 +87,9 @@ public function decode()
8787
}
8888
}
8989

90-
public function text()
90+
public function text($hints = null)
9191
{
92-
$this->decode();
92+
$this->decode($hints);
9393

9494
if ($this->result !== false && method_exists($this->result, 'toString')) {
9595
return $this->result->toString();

lib/Qrcode/Detector/FinderPatternFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct($image, $resultPointCallback = null)
5959

6060
final public function find($hints)
6161
{/*final FinderPatternInfo find(Map<DecodeHintType,?> hints) throws NotFoundException {*/
62-
$tryHarder = true;//$hints != null && $hints['TRY_HARDER'];
62+
$tryHarder = $hints != null && $hints['TRY_HARDER'];
6363
$pureBarcode = $hints != null && $hints['PURE_BARCODE'];
6464
$maxI = $this->image->getHeight();
6565
$maxJ = $this->image->getWidth();

0 commit comments

Comments
 (0)